chiark / gitweb /
set: make set_consume() actually free the allocated string if the string already...
authorLennart Poettering <lennart@poettering.net>
Wed, 19 Nov 2014 15:43:03 +0000 (16:43 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 19 Nov 2014 23:01:05 +0000 (00:01 +0100)
src/shared/hashmap.c

index 2bc3b38..5b329e0 100644 (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;