Re: [PATCH] ota_tokenize_bookmarks

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi,

committed to cvs.

Thanks,
Alex

Rene Kluwen schrieb:
> 
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]On
> Behalf Of Alexander Malysh
> Sent: donderdag 6 april 2006 12:01
> To: [email protected]
> 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);
>>     }
>>
>>
>>
> 
> 
>
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.