bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnu-libiconv] Resource leaks in get_charset_aliases function in lib


From: prabhat kanth
Subject: [bug-gnu-libiconv] Resource leaks in get_charset_aliases function in libcharset/lib/localcharset.c file
Date: Tue, 16 Jul 2013 15:11:25 +0530

Hello,
 
 
Details:
 
Resource leaks in get_charset_aliases function  in libcharset/lib/localcharset.c file
 
Cause:

"dir" is not free, if it is allocated by relocate() defined in file "lib/relocatable.c" .relocate() is using xmalloc and it's returning allocated memory to "dir".
 
Solution:
 
1.we have declared a flag "mallocked_dir_flag" which is initially 0 which will check whether the value "dir" get from relocate() defined in file "lib/relocatable.c" is using xmalloc
 
2.We have defined "predefined_libdir" and initialised by "LIBDIR" as:
   const char * predefined_libdir="LIBDIR";
   and "mallocked_dir_flag" is set to 1 if "dir" is not equal to
   "predefined_libdir" i.e. "LIBDIR".
 
3.If "mallocked_dir_flag" is 1 we free the "dir".
 
For more clarification the respective patch has been attached.
 
Note : I have raised this bug in https://savannah.gnu.org/bugs/?39489. But I find there has been no work in ICONV for 23 months. Please let me know whom to contact.

Thanks and Regards,
Prabhat Ranjan Kanth
Software Developer, SISC India
Contact no:-9716063489

Attachment: libiconv_memfix.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]