mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 16:59:03 +03:00
sd-rtnl: modernize a bit
This commit is contained in:
parent
5fa4ddb88c
commit
689703f618
@ -31,7 +31,7 @@
|
||||
#include "rtnl-util.h"
|
||||
|
||||
static int sd_rtnl_new(sd_rtnl **ret) {
|
||||
sd_rtnl *rtnl;
|
||||
_cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
|
||||
|
||||
assert_return(ret, -EINVAL);
|
||||
|
||||
@ -52,12 +52,12 @@ static int sd_rtnl_new(sd_rtnl **ret) {
|
||||
/* We guarantee that wqueue always has space for at least
|
||||
* one entry */
|
||||
rtnl->wqueue = new(sd_rtnl_message*, 1);
|
||||
if (!rtnl->wqueue) {
|
||||
free(rtnl);
|
||||
if (!rtnl->wqueue)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
*ret = rtnl;
|
||||
rtnl = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user