diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-10-08 15:49:04 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-10-08 22:40:18 +0200 |
commit | fd8213f83d0656bd0cd5215306e22e5a25058bee (patch) | |
tree | 4c6fdf202bbd6ac8605730d75815741b1eacca62 | |
parent | d0302f12c4d33eabbcbaf23e941ac33e1e364e3d (diff) |
libfshelp: properly free active translator entries
Previously the dynamically allocated field name leaks. Fix this by
properly freeing the objects of type struct translator.
* libfshelp/translator-list.c (translator_ihash_cleanup): Fix memory leak.
-rw-r--r-- | libfshelp/translator-list.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libfshelp/translator-list.c b/libfshelp/translator-list.c index 99a858f4..87dcb211 100644 --- a/libfshelp/translator-list.c +++ b/libfshelp/translator-list.c @@ -47,9 +47,12 @@ static pthread_mutex_t translator_ihash_lock = PTHREAD_MUTEX_INITIALIZER; static void translator_ihash_cleanup (void *element, void *arg) { + struct translator *translator = element; + /* No need to deallocate port, we only keep the name of the port, not a reference. */ - free (element); + free (translator->name); + free (translator); } /* Record an active translator being bound to the given file name |