Skip to content

Commit

Permalink
mount: Fix two memory leaks
Browse files Browse the repository at this point in the history
This ensures we get a clean `-fsanitize=address` run.

Signed-off-by: Colin Walters <walters@verbum.org>
  • Loading branch information
cgwalters committed Jun 21, 2023
1 parent 8792e15 commit ee9dd10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions libcomposefs/lcfs-mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ static int lcfs_mount_erofs_ovl(struct lcfs_mount_state_s *state,
workdir = escape_mount_option(options->workdir);

retry:
free(steal_pointer(&overlay_options));
res = asprintf(&overlay_options,
"metacopy=on,redirect_dir=on,lowerdir=%s%s%s%s%s%s",
lowerdir[lowerdir_alt], upperdir ? ",upperdir=" : "",
Expand Down
2 changes: 2 additions & 0 deletions tools/mountcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,7 @@ int main(int argc, char **argv)
strerror(errno));
}

free(options.objdirs);

return 0;
}

0 comments on commit ee9dd10

Please sign in to comment.