Memory leak suspicion in wap-appl.c

Vjacheslav Chekushin <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization LMT
Message-ID <[email protected]>
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 ;-) .

-- 
Vjacheslav Chekushin                                mailto:[email protected]
Latvian Mobile Phone Company                        http://www.lmt.lv
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.