mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Signed-off-by: K. Y. Srinivasan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
dafffd88e8
commit
57969af029
1 changed files with 1 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue