bug#19578: Memory leaks in coreutils/lib/locale_charset.c

2015-01-13 Thread Pádraig Brady
tag 19578 notabug close 19578 stop On 13/01/15 09:35, Daiki Ueno wrote: Zhaopeng Li z...@ustc.edu.cn writes: At line 534 of coreutils/lib/locale_charset.c, var ‘aliases' points to a buffer which is allocated using malloc() . This buffer is not freed when codeset is still an empty string

bug#19578: the code

2015-01-13 Thread Zhaopeng Li
At line 589 of coreutils/lib/locale_charset.c, var ‘aliases' points to a buffer which is allocated using malloc() .This buffer is not freed when codeset is still an empty string after the loop (Line 589~597). So it will be leaked under such situation. Our static analysis tool reports this

bug#19578: Memory leaks in coreutils/lib/locale_charset.c

2015-01-13 Thread Daiki Ueno
Zhaopeng Li z...@ustc.edu.cn writes: At line 534 of coreutils/lib/locale_charset.c, var ‘aliases' points to a buffer which is allocated using malloc() . This buffer is not freed when codeset is still an empty string after the loop (Line 534~542). So it will be leaked under such situation.

bug#19580: Memory Leak in coreutils/lib/localcharset.c

2015-01-13 Thread Zhaopeng Li
At line 221, the assignment (old_res_ptr = res_ptr) will lead to memory leak when iteration of corresponding loop is greater than 3. 189 http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/localcharset.c;h=b4af28cd#l189 /* Parse the file's contents. */ 190

bug#19580: Memory Leak in coreutils/lib/localcharset.c

2015-01-13 Thread Pádraig Brady
forcemerge 19580 19578 stop On 13/01/15 10:31, Zhaopeng Li wrote: At line 221, the assignment (old_res_ptr = res_ptr) will lead to memory leak when iteration of corresponding loop is greater than 3. Same non issue really. We don't want to free() here. I'm not sure how to avoid the warning