buglibiconv - Bugs: bug #39489, Resource leaks in...

 
 

bug #39489: Resource leaks in get_charset_aliases function in libcharset/lib/localcharset.c file

Submitted by:  Prabhat Kanth <prabhatkanth>
Submitted on:  Mon 15 Jul 2013 10:03:07 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 15 Jul 2013 10:03:07 AM UTC, original submission:

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

Prabhat Kanth <prabhatkanth>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #28586:  libiconv_memfix.patch added by prabhatkanth (1kB - application/octet-stream - Resource leaks in libcharset/lib/localcharset.c file)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by prabhatkanth (Submitted the item)
  • -unavailable- added by prabhatkanth
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 15 Jul 2013 10:03:07 AM UTCprabhatkanthAttached File-=>Added libiconv_memfix.patch, #28586
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup