From 0ddc209efd87a1e0ccaf0e738a51e7a975a4f8e3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 19 Nov 2014 16:43:03 +0100 Subject: set: make set_consume() actually free the allocated string if the string already is in the set Signed-off-by: Anthony G. Basile --- src/shared/hashmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c index 2bc3b38739..5b329e0851 100644 --- a/src/shared/hashmap.c +++ b/src/shared/hashmap.c @@ -1810,7 +1810,7 @@ int set_consume(Set *s, void *value) { int r; r = set_put(s, value); - if (r < 0) + if (r <= 0) free(value); return r; -- cgit v1.2.3-54-g00ecf