summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2018-04-12 22:14:52 +0200
committerHans Dedecker <dedeckeh@gmail.com>2018-04-12 22:16:50 +0200
commit1e2cf67ef36eaaed9a7f18898066df5c2366fd0d (patch)
treec2ccc6461445fd18840a1d7cae2ea8b67b08db83
parentb409c78066ea6fe2c2451ede86a2303c413b5e4b (diff)
system-linux: fix memory leak on error in system_add_vxlan()
Detected by coverity in CID 1412449 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r--system-linux.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/system-linux.c b/system-linux.c
index 0ca5256..6fb0a01 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -2824,8 +2824,10 @@ static int system_add_vxlan(const char *name, const unsigned int link, struct bl
unsigned tos = 1;
if (strcmp(str, "inherit")) {
- if (!system_tos_aton(str, &tos))
- return -EINVAL;
+ if (!system_tos_aton(str, &tos)) {
+ ret = -EINVAL;
+ goto failure;
+ }
}
nla_put_u8(msg, IFLA_VXLAN_TOS, tos);