ota_tokenize_bookmarks
"Rene Kluwen" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
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);
}