PATCH: Memory leak in Clickatell + Brunet HTTP SMSC
"Donald Jackson" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi everyone, Attached is a diff for memory leak found in smsc_http.c for Clickatell and Brunet specific implementations. The message ID Octstr's never get destroyed when the dictionary gets destroyed. Thank you! -- Donald Jackson http://www.ddj.co.za/ donaldjster(a)gmail.com
smsc_http.c.diff
(application/octet-stream, 1.2 KB)
Index: smsc_http.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_http.c,v
retrieving revision 1.55
diff -u -r1.55 smsc_http.c
--- smsc_http.c 9 Jan 2008 20:06:52 -0000 1.55
+++ smsc_http.c 14 Jul 2008 08:42:54 -0000
@@ -720,11 +720,11 @@
word = gwlist_extract_first(words);
if (octstr_compare(word, octstr_imm("ID:")) == 0) {
value = gwlist_extract_first(words);
- param = dict_create(4, NULL);
+ param = dict_create(4, (void(*)(void *)) octstr_destroy);
dict_put(param, octstr_imm("ID"), value);
} else if (octstr_compare(word, octstr_imm("ERR:")) == 0) {
value = gwlist_extract_first(words);
- param = dict_create(4, NULL);
+ param = dict_create(4, (void(*)(void *)) octstr_destroy);
dict_put(param, octstr_imm("ERR"), value);
}
octstr_destroy(word);
@@ -1007,7 +1007,7 @@
words = octstr_split_words(body);
if ((len = gwlist_len(words)) > 0) {
- param = dict_create(4, NULL);
+ param = dict_create(4, (void(*)(void *)) octstr_destroy);
while ((word = gwlist_extract_first(words)) != NULL) {
List *l = octstr_split(word, octstr_imm("="));
Octstr *key = gwlist_extract_first(l);