eloop: fix memory loop when signal registration fails
If the signal-registration fails, we need to destroy it again. Otherwise, it will keep a reference to the current eloop-object and hence it will never get freed. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
46898b1090
commit
57f85f91ce
@ -2186,7 +2186,13 @@ int ev_eloop_register_signal_cb(struct ev_eloop *loop, int signum,
|
||||
return ret;
|
||||
}
|
||||
|
||||
return shl_hook_add_cast(sig->hook, cb, data);
|
||||
ret = shl_hook_add_cast(sig->hook, cb, data);
|
||||
if (ret) {
|
||||
signal_free(sig);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user