Skip to content

Commit

Permalink
mkcomposefs: Add missing free()
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Sjölund <[email protected]>
  • Loading branch information
eriksjolund committed Mar 25, 2024
1 parent fc9a526 commit a880713
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/mkcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static char *unescape_string(const char *escaped, size_t escaped_size,
size_t *unescaped_size, char **err)
{
const char *escaped_end = escaped + escaped_size;
char *res = malloc(escaped_size + 1);
cleanup_free char *res = malloc(escaped_size + 1);
if (res == NULL)
oom();
char *out = res;
Expand Down Expand Up @@ -182,7 +182,7 @@ static char *unescape_string(const char *escaped, size_t escaped_size,

*out = 0; /* Null terminate */

return res;
return steal_pointer(&res);
}

static char *unescape_optional_string(const char *escaped, size_t escaped_size,
Expand Down

0 comments on commit a880713

Please sign in to comment.