-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Alexander Malysh
Sent: donderdag 6 april 2006 12:01
To: devel@kannel.org
Subject: Re: ota_tokenize_bookmarks


Hi Rene,

you are right about memleaks. Could you please provide patch?

Thanks,
Alex

Rene Kluwen schrieb:
> I was looking at the file ota_prov.c.
> When I sent an ota-bookmark to myself, on a Siemens C60, I get an SMS
> message with garbage.
> Has anybody experienced this as well? And better: Does anyone have a
> solution for this?
>
> Another reason to write this email is, when looking at line 487 & 506, the
> octstr_append function
> is called with octstr_duplicate as parameter.
>
> When looking at the octstr_append fn (and further down into
> octstr_insert()), I see no disposal of
> that parameter. Shouldn't the octstr_duplicate function call in the second
> parameter be removed??
> Am I seeing things wrong here?
>
> See the code below: I marked the havoc lines with comments.
>
>
>     /* name */
>     if (name != NULL) {
>         /* PARM with attributes */
>         octstr_append_from_hex(msg->sms.msgdata, "87");
>         /* NAME=PROXY, VALUE, inline string */
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_NAME_NAME);
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_VALUE);
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_STR_I);
>         octstr_append(msg->sms.msgdata, octstr_duplicate(name));
> /* <===== MEMORY LEAK?? */
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_END_STR_I);
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_END);
>     }
>     /* URL */
>     if (url != NULL) {
>         /* PARM with attributes */
>         octstr_append_from_hex(msg->sms.msgdata, "87");
>         /* NAME=PROXY, VALUE, inline string */
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_NAME_URL);
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_VALUE);
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_STR_I);
>         octstr_append(msg->sms.msgdata, octstr_duplicate(url));
> /* <======= MEMORY LEAK?? */
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_END_STR_I);
>         octstr_append_char(msg->sms.msgdata, WBXML_TOK_END);
>     }
>
>
>



Attachment: ota_leak.patch
Description: Binary data

Reply via email to