1
0
mirror of https://github.com/systemd/systemd synced 2024-07-09 04:26:06 +00:00

initctl: use _cleanup_

This commit is contained in:
David Tardon 2023-04-21 15:34:11 +02:00
parent 70bbf65942
commit 0a956e8e02

View File

@ -284,7 +284,7 @@ static int server_init(Server *s, unsigned n_sockets) {
static int process_event(Server *s, struct epoll_event *ev) {
int r;
Fifo *f;
_cleanup_(fifo_freep) Fifo *f = NULL;
assert(s);
assert(ev);
@ -295,11 +295,10 @@ static int process_event(Server *s, struct epoll_event *ev) {
f = (Fifo*) ev->data.ptr;
r = fifo_process(f);
if (r < 0) {
log_info_errno(r, "Got error on fifo: %m");
fifo_free(f);
return r;
}
if (r < 0)
return log_info_errno(r, "Got error on fifo: %m");
TAKE_PTR(f);
return 0;
}