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:
76c37ab
)
network-intenal: user _cleanup_ macro in parse_ifname
author
Tom Gundersen
<teg@jklm.no>
Fri, 9 Jan 2015 23:33:46 +0000
(
00:33
+0100)
committer
Tom Gundersen
<teg@jklm.no>
Mon, 12 Jan 2015 17:19:16 +0000
(18:19 +0100)
src/libsystemd-network/network-internal.c
patch
|
blob
|
history
diff --git
a/src/libsystemd-network/network-internal.c
b/src/libsystemd-network/network-internal.c
index
6852a71
..
e4a15d0
100644
(file)
--- a/
src/libsystemd-network/network-internal.c
+++ b/
src/libsystemd-network/network-internal.c
@@
-224,7
+224,7
@@
int config_parse_ifalias(const char *unit,
void *userdata) {
char **s = data;
-
char *n
;
+
_cleanup_free_ char *n = NULL
;
assert(filename);
assert(lvalue);
@@
-238,17
+238,15
@@
int config_parse_ifalias(const char *unit,
if (!ascii_is_valid(n) || strlen(n) >= IFALIASZ) {
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
"Interface alias is not ASCII clean or is too long, ignoring assignment: %s", rvalue);
- free(n);
return 0;
}
free(*s);
- if (*n)
+ if (*n)
{
*s = n;
- else {
- free(n);
+ n = NULL;
+ } else
*s = NULL;
- }
return 0;
}