Re: Memory leak suspicion in wap-appl.c

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>
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.