summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2018-06-04 16:07:51 +0200
committerSander Vrijders <[email protected]>2018-06-04 16:17:35 +0200
commit574132342b29e61a3ee3315434c744f19605ed28 (patch)
tree7300c0865748c74d945b3647c5183abe4593f538 /src
parent6bfe0080bf347a1f4baad32070913b2edfd27214 (diff)
downloadouroboros-574132342b29e61a3ee3315434c744f19605ed28.tar.gz
ouroboros-574132342b29e61a3ee3315434c744f19605ed28.zip
lib: Fix memleak in hashtable test
The element was not freed if insertion failed. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/lib/tests/hashtable_test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/tests/hashtable_test.c b/src/lib/tests/hashtable_test.c
index d8cc73c5..e3127743 100644
--- a/src/lib/tests/hashtable_test.c
+++ b/src/lib/tests/hashtable_test.c
@@ -64,6 +64,7 @@ int hashtable_test(int argc, char ** argv)
if (htable_insert(table, i, (void *) j, 1)) {
printf("Failed to insert.\n");
htable_destroy(table);
+ free(j);
return -1;
}
}