Tools: hv: in kvp_set_ip_info free mac_addr right after usage
PATCH 1/1 Tools: hv: in kvp_set_ip_info free mac_addr right after usage
... to simplify error path in upcoming changes.
--- tools/hv/hv_kvp_daemon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/hv/hv_kvp_daemon.c +1 -2
@@ -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; }
Quoted 9 lines
-----Original Message-----
From: Olaf Hering [mailto:[email protected]]
Sent: Thursday, August 01, 2013 8:58 AM
To: KY Srinivasan; [email protected]
Cc: [email protected]; Olaf Hering
Subject: [PATCH] Tools: hv: inkvp_set_ip_infofreemac_addrright after usage
Quoted 3 lines
... to simplify error path in upcoming changes.
Signed-off-by Olaf Hering <[email protected]>
Quoted 36 lines
--- tools/hv/hv_kvp_daemon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)tools/hv/hv_kvp_daemon.c +1
-1@@ -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);tools/hv/hv_kvp_daemon.c +0
-1/* @@ -1358,7 +1358,6 @@ setval_done: setval_error:syslog (LOG_ERR ,"Failed to write config file" ); -free (mac_addr);fclose (file);return error; }
Quoted 9 lines · KY Srinivasan
Quoted 9 lines
-----Original Message-----
From: Olaf Hering [mailto:[email protected]]
Sent: Thursday, August 01, 2013 8:58 AM
To: KY Srinivasan; [email protected]
Cc: [email protected]; Olaf Hering
Subject: [PATCH] Tools: hv: inkvp_set_ip_infofreemac_addrright after usage
Quoted 4 lines
Quoted 3 lines
... to simplify error path in upcoming changes.
Signed-off-by Olaf Hering <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>
Can you resend this as well?
thanks,
greg k-h