recovery: free strings returned by uboot_getenv()
The function uboot_getenv() is a wrapper over libuboot_get_env() and
requires that the returned strings are freed when no longer in use.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
https://onedigi.atlassian.net/browse/DEL-7645
(cherry picked from commit 27ce7a4f20)
This commit is contained in:
parent
c93945c995
commit
90706f5d39
|
|
@ -96,6 +96,7 @@ static bool is_dualboot_enabled(void)
|
|||
if (!strcmp(var, "yes"))
|
||||
ret = true;
|
||||
|
||||
free(var);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -148,6 +149,7 @@ static int append_recovery_command(const char *value)
|
|||
free(new_recovery_cmd);
|
||||
|
||||
err:
|
||||
free(old_recovery_cmd);
|
||||
return ret ? -1 : 0;
|
||||
}
|
||||
|
||||
|
|
@ -522,6 +524,7 @@ static int parse_nand_partition_info(char **parts, char **encrypted, unsigned ch
|
|||
err:
|
||||
if (tmp)
|
||||
free(tmp);
|
||||
free(var);
|
||||
|
||||
/* NULL-terminate the arrays */
|
||||
parts[i] = NULL;
|
||||
|
|
@ -588,6 +591,7 @@ err:
|
|||
pclose(fp);
|
||||
if (tmp)
|
||||
free(tmp);
|
||||
free(var);
|
||||
|
||||
/* NULL-terminate the parts array */
|
||||
parts[i] = NULL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue