mirror of
https://github.com/dgibson/dtc.git
synced 2026-01-22 01:30:34 -05:00
fdtput.c: Fix memory leak.
CID 132821 (#1 of 1): Resource leak (RESOURCE_LEAK) 12. leaked_storage: Variable value going out of scope leaks the storage it points to. Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
f79ddb83e1
commit
c539075ba8
1 changed files with 6 additions and 1 deletions
7
fdtput.c
7
fdtput.c
|
|
@ -328,7 +328,7 @@ static int delete_node(char *blob, const char *node_name)
|
|||
static int do_fdtput(struct display_info *disp, const char *filename,
|
||||
char **arg, int arg_count)
|
||||
{
|
||||
char *value;
|
||||
char *value = NULL;
|
||||
char *blob;
|
||||
char *node;
|
||||
int len, ret = 0;
|
||||
|
|
@ -374,6 +374,11 @@ static int do_fdtput(struct display_info *disp, const char *filename,
|
|||
}
|
||||
|
||||
free(blob);
|
||||
|
||||
if (value) {
|
||||
free(value);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue