set: make set_consume() actually free the allocated string if the string already is in the set
This commit is contained in:
parent
a1ad376761
commit
575ccc1b69
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue