]> git.ipfire.org Git - thirdparty/kmod.git/commit - shared/hash.c
libkmod-hash: Plug possible memory leak when free_value is defined
authorLeandro Pereira <leandro@hardinfo.org>
Fri, 12 Oct 2012 15:28:56 +0000 (12:28 -0300)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 12 Oct 2012 15:34:27 +0000 (12:34 -0300)
commit1faec2c1344fd2725152a6944dc5ac2525999ec6
treec9dcac4eccaefa140399950d407ddee1ff8a62b6
parent66f3228d17d66d7e2dd484427259290fbc82b2f0
libkmod-hash: Plug possible memory leak when free_value is defined

Although the hash table implementation allows passing a callback function
to free a value when it is removed from the hash table, hash_del() wasn't
freeing it if it was provided. Now it does.

As a bonus, it now checks if the callback is set in hash_add() as well.
libkmod/libkmod-hash.c