[PATCH] Fix some memory leaks

Lubomir I. Ivanov neolit123 at gmail.com
Mon Mar 23 08:20:34 PDT 2015


On 22 March 2015 at 17:46, Claudiu Olteanu
<olteanu.vasilica.claudiu at gmail.com> wrote:
> I added more patches which will fix some memory leaks.
> Regarding the uemis-downloader.c source I am not sure if
> "iparam_buff" and "mbuf" variables should be freed too.
>
> I saw that one of the elements of "param_buff" is used as a result for the
> "do_uemis_import" function, but I didn't saw where it is freed.
>

if you are not sure about a certain memory allocation don't fix it,
because it can create bugs that are very difficult to debug and can
only be tested fully on a specific device. :\
i don't have the time to check "param_buff" ATM, leave it be for now,
or once you find the answer, provide your train of though in the
commit message on why it should be freed.

1) same as the first message
2) looks good, yet it will go with the process heap map (i.e. one time
leak). still, to silence valgrind or similar tools the change is fine.
3) looks good to me. the string will be strdup-ed, and tmp can be freed.
4) also seems good

lubomir
--


More information about the subsurface mailing list