Commit 57969af0 authored by Olaf Hering's avatar Olaf Hering Committed by Greg Kroah-Hartman

Tools: hv: in kvp_set_ip_info free mac_addr right after usage

... to simplify error path in upcoming changes.
Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dafffd88
......@@ -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 @@ static int kvp_set_ip_info(char *if_name, struct hv_kvp_ipaddr_value *new_val)
setval_error:
syslog(LOG_ERR, "Failed to write config file");
free(mac_addr);
fclose(file);
return error;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment