Skip to content

Commit

Permalink
fs/hfsplus: fix memory leak.
Browse files Browse the repository at this point in the history
Found by: Coverity scan.
  • Loading branch information
arvidjaar committed Jan 27, 2015
1 parent 3900726 commit edc94e4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions grub-core/fs/hfsplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,10 @@ list_nodes (void *record, void *hook_arg)

/* If the name is obviously invalid, skip this node. */
if (catkey->name[i] == 0)
return 0;
{
grub_free (filename);
return 0;
}
}

*grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey->name,
Expand All @@ -745,7 +748,10 @@ list_nodes (void *record, void *hook_arg)
callback function. */
node = grub_malloc (sizeof (*node));
if (!node)
return 1;
{
grub_free (filename);
return 1;
}
node->data = ctx->dir->data;
node->compressed = 0;
node->cbuf = 0;
Expand Down

0 comments on commit edc94e4

Please sign in to comment.