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

Signed-off-by: Andreas Henriksson <andr...@fatal.se>
---
 src/libsystemd-network/network-internal.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/libsystemd-network/network-internal.c 
b/src/libsystemd-network/network-internal.c
index 208c314..372f3ed 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;
         }
 
-- 
2.1.0

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to