Re: PATCH: Memory leak in Clickatell + Brunet HTTP SMSC
Stipe Tolj <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Organization | tolj.org system architecture |
| Message-ID | <[email protected]> |
Werner Coetzee schrieb:
> Hi Stipe
>
> I must disagree with you (unfortunately).
> If you look closely, you'll see that:
> word = gwlist_extract_first(words);
> and
> value = gwlist_extract_first(words);
> is used on the list, (i.e. 2 elements removed from the list), and when gwlist_destroy is called, 'word' and 'value' is not destroyed.
> There is an octstr_destroy(word), but there is no octstr_destroy(value), and because there is no callback for the 'param' dictionary, 'value' never will be destroyed, resulting in a memory leak.
>
> The patch you provided creates a copy of 'value' which will be destroyed via the callback when dict_destroy is called, but the original 'value' will still reside in memory indefinitely. So I would go for the patch provided by Mr. Jackson, or you should add a octstr_destroy(value) to your patch.
yup Werner, thanks for the shot here. You're of course right. I wasn't having my
eyes on the missing octstr_destroy(value) itself. Credits on your eyes here ;)
Stipe
-------------------------------------------------------------------
Kölner Landstrasse 419
40589 Düsseldorf, NRW, Germany
tolj.org system architecture Kannel Software Foundation (KSF)
http://www.tolj.org/ http://www.kannel.org/
mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org
-------------------------------------------------------------------