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

This commit is contained in:
Lennart Poettering 2014-11-19 16:43:03 +01:00
parent a1ad376761
commit 575ccc1b69

View file

@ -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;