Skip to content

Commit

Permalink
Merge pull request #267 from eriksjolund/mkcomposefs-add-missing-free
Browse files Browse the repository at this point in the history
mkcomposefs: Add missing free()
  • Loading branch information
cgwalters committed Mar 25, 2024
2 parents 1179638 + a880713 commit 1eecf38
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 1eecf38

Please sign in to comment.