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:
Jean-Christophe Dubois 2016-07-13 00:36:21 +02:00 committed by David Gibson
parent f79ddb83e1
commit c539075ba8

View file

@ -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;
}