Re: Memory leak suspicion in wap-appl.c

"Alex Judd" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <03e501c2bb2f$3934e4e0$0201640a@alexcompaq1>
I can see no problems with the proposed changes. octstr_destroy checks
whether the octstr is null before trying to destroy it anyway so will cause
no adverse effects.

Alex

----- Original Message -----
From: "Stipe Tolj" <[email protected]>
To: <[email protected]>
Cc: "devel" <[email protected]>
Sent: Monday, January 13, 2003 4:15 PM
Subject: Re: Memory leak suspicion in wap-appl.c


> Vjacheslav Chekushin wrote:
> >
> > Hi, list.
> > I suspect memory leak in wap-appl.c
> > It's about set_referer_url():
> >
> > static void set_referer_url(Octstr *url, WSPMachine *sm)
> > {
> >          gw_assert(url != NULL);
> >          gw_assert(sm != NULL);
> >
> >      sm->referer_url = octstr_duplicate(url);
> > }
> >
> > In wap-appl.c we use it:
> >
> >              if (session_id != -1) {
> >                  debug("wap.wsp.http",0,"WSP: Setting Referer URL to
<%s>",
> >                        octstr_get_cstr(url));
> >                  if ((sm = find_session_machine_by_id(session_id)) !=
NULL) {
> >                      set_referer_url(url, sm);
> >                  } else {
> >                      error(0,"WSP: Failed to find session machine for ID
%ld",
> >                            session_id);
> >                  }
> >              }
> >
> > I don't see where preovious sm->referer_url destroyed.
> > Must we before
> > sm->referer_url = octstr_duplicate(url);
> > Insert
> > octstr_destroy(sm->referer_url); ?
> >
> > Or may be I simply didn't find where it destroyed ;-) .
>
> any comments from the crew here?!
>
> [email protected]
> -------------------------------------------------------------------
> Wapme Systems AG
>
> Vogelsanger Weg 80
> 40470 Düsseldorf
>
> Tel: +49-211-74845-0
> Fax: +49-211-74845-299
>
> E-Mail: [email protected]
> Internet: http://www.wapme-systems.de
> -------------------------------------------------------------------
> wapme.net - wherever you are
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.