summaryrefslogtreecommitdiffstats
path: root/tools/hv/hv_kvp_daemon.c
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2013-08-04 16:41:24 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-05 14:36:31 +0800
commit57969af029b073a99ce27c2170cbcac5bd557606 (patch)
treec8a620a1a04732e698711f9aa198d9b717085b6c /tools/hv/hv_kvp_daemon.c
parentdafffd88e88493f4e8693a51b285a5d4c828fd6f (diff)
downloadop-kernel-dev-57969af029b073a99ce27c2170cbcac5bd557606.zip
op-kernel-dev-57969af029b073a99ce27c2170cbcac5bd557606.tar.gz
Tools: hv: in kvp_set_ip_info free mac_addr right after usage
... to simplify error path in upcoming changes. Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/hv/hv_kvp_daemon.c')
-rw-r--r--tools/hv/hv_kvp_daemon.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 418ac55..ba075e5 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -1299,6 +1299,7 @@ static int kvp_set_ip_info(char *if_name, struct hv_kvp_ipaddr_value *new_val)
}
error = kvp_write_file(file, "HWADDR", "", mac_addr);
+ free(mac_addr);
if (error)
goto setval_error;
@@ -1344,7 +1345,6 @@ static int kvp_set_ip_info(char *if_name, struct hv_kvp_ipaddr_value *new_val)
goto setval_error;
setval_done:
- free(mac_addr);
fclose(file);
/*
@@ -1358,7 +1358,6 @@ setval_done:
setval_error:
syslog(LOG_ERR, "Failed to write config file");
- free(mac_addr);
fclose(file);
return error;
}
OpenPOWER on IntegriCloud