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