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:
parent
d378ef708b
commit
648c339c49
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue