summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2014-09-16 15:50:58 +0200
committerTom Gundersen <teg@jklm.no>2014-09-16 16:20:41 +0200
commit2833796106420e4634543d06052482f75cbb5762 (patch)
treefc8562ea2bda7c80dd5c2f353055c6caf6947676
parent821b2e792159e237a1e5a1ea4bb6ae2e55d64be5 (diff)
libsystemd-network: avoid double-free in error case
Don't manually free 'n' in error path as it's already tagged _cleanup_free_ and will be freed once it goes out of scope, leading to double-free in this case. Found with coverity. Fixes: CID#1237786
-rw-r--r--src/libsystemd-network/network-internal.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c
index 208c314695..372f3ed371 100644
--- a/src/libsystemd-network/network-internal.c
+++ b/src/libsystemd-network/network-internal.c
@@ -199,7 +199,6 @@ int config_parse_ifname(const char *unit,
if (!ascii_is_valid(n) || strlen(n) >= IFNAMSIZ) {
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
"Interface name is not ASCII clean or is too long, ignoring assignment: %s", rvalue);
- free(n);
return 0;
}