public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Tools: hv: in kvp_set_ip_info free mac_addr right after usage
@ 2013-08-01 12:58 Olaf Hering
  2013-08-01 14:35 ` KY Srinivasan
  0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2013-08-01 12:58 UTC (permalink / raw)
  To: kys, gregkh; +Cc: linux-kernel, Olaf Hering

... to simplify error path in upcoming changes.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/hv/hv_kvp_daemon.c | 3 +--
 1 file changed, 1 insertion(+), 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;
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-02  3:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01 12:58 [PATCH] Tools: hv: in kvp_set_ip_info free mac_addr right after usage Olaf Hering
2013-08-01 14:35 ` KY Srinivasan
2013-08-02  3:12   ` gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox