Re: [PATCH] http.c

Nisan Bloch <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi
At 01:15 AM 12/3/02 +0100, Stipe Tolj wrote:
> >
> > small memory leak in http.c,
> >
> > --- gwlib/http.c        Mon Nov 18 08:02:13 2002
> > +++ ../../gateway-cvsup/gwlib/http.c    Mon Nov 25 11:45:50 2002
> > @@ -1226,6 +1226,10 @@
> >     path = NULL;
> >     request = NULL;
> >
> > +  if (trans->host != NULL)
> > +         octstr_destroy(trans->host);
> > +  trans->host = NULL;
> > +
> >     if (parse_url(trans->url, &trans->host, &trans->port, &path, 
> &trans->ssl,
> >                  &trans->username, &trans->password) == -1)
>
>I don't think this is necessary, see gwlib/octstr.c:244:


the check for != NULL is not necessary, yes. But the octstr_destroy is, as 
in http.c:parse_url:1155 , host is created.
*host = octstr_copy(url, prefix_len, host_len);

Nisan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.