summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-19 16:43:03 +0100
committerAnthony G. Basile <blueness@gentoo.org>2014-11-20 06:43:53 -0500
commit0ddc209efd87a1e0ccaf0e738a51e7a975a4f8e3 (patch)
tree7dff16046f5a699bc442b35cd12bff7748022cb9 /src
parent690c8559602524a2dd506516eb119fd5063d2c83 (diff)
set: make set_consume() actually free the allocated string if the string already is in the set
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r--src/shared/hashmap.c2
1 files changed, 1 insertions, 1 deletions
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;