mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-28 17:10:23 +00:00
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:
committed by
Zbigniew Jędrzejewski-Szmek
parent
72dec81208
commit
51affe24d5
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user