fs/hfsplus: fix memory leak.
Found by: Coverity scan.
This commit is contained in:
parent
3900726fa8
commit
edc94e4b0b
1 changed files with 8 additions and 2 deletions
|
@ -723,7 +723,10 @@ list_nodes (void *record, void *hook_arg)
|
||||||
|
|
||||||
/* If the name is obviously invalid, skip this node. */
|
/* If the name is obviously invalid, skip this node. */
|
||||||
if (catkey->name[i] == 0)
|
if (catkey->name[i] == 0)
|
||||||
return 0;
|
{
|
||||||
|
grub_free (filename);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey->name,
|
*grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey->name,
|
||||||
|
@ -745,7 +748,10 @@ list_nodes (void *record, void *hook_arg)
|
||||||
callback function. */
|
callback function. */
|
||||||
node = grub_malloc (sizeof (*node));
|
node = grub_malloc (sizeof (*node));
|
||||||
if (!node)
|
if (!node)
|
||||||
return 1;
|
{
|
||||||
|
grub_free (filename);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
node->data = ctx->dir->data;
|
node->data = ctx->dir->data;
|
||||||
node->compressed = 0;
|
node->compressed = 0;
|
||||||
node->cbuf = 0;
|
node->cbuf = 0;
|
||||||
|
|
Loading…
Reference in a new issue