logind: fix possible memleak of message if the message was already in the set
I'm not sure if it is actually possible to encounter this condition. But let's make the handling correct regardless.
This commit is contained in:
@@ -175,9 +175,8 @@ static int set_add_message(Set **set, sd_bus_message *message) {
|
||||
return r;
|
||||
|
||||
r = set_ensure_put(set, &bus_message_hash_ops, message);
|
||||
if (r < 0)
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
sd_bus_message_ref(message);
|
||||
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user