projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5fa4ddb
)
sd-rtnl: modernize a bit
author
Tom Gundersen
<teg@jklm.no>
Mon, 31 Mar 2014 12:43:34 +0000
(14:43 +0200)
committer
Tom Gundersen
<teg@jklm.no>
Mon, 31 Mar 2014 12:43:34 +0000
(14:43 +0200)
src/libsystemd/sd-rtnl/sd-rtnl.c
patch
|
blob
|
history
diff --git
a/src/libsystemd/sd-rtnl/sd-rtnl.c
b/src/libsystemd/sd-rtnl/sd-rtnl.c
index
9f3a4f3
..
2ab9d90
100644
(file)
--- a/
src/libsystemd/sd-rtnl/sd-rtnl.c
+++ b/
src/libsystemd/sd-rtnl/sd-rtnl.c
@@
-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;
}