set: make set_consume() actually free the allocated string if the string already is in the set

(cherry picked from commit 575ccc1b69)

Conflicts:
	src/shared/hashmap.c
This commit is contained in:
Lennart Poettering
2015-01-16 00:56:50 -05:00
committed by Zbigniew Jędrzejewski-Szmek
parent 72dec81208
commit 51affe24d5
+1 -1
View File
@@ -54,7 +54,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;