Skip to content

Commit

Permalink
Merge pull request #160 from cgwalters/close-memleaks
Browse files Browse the repository at this point in the history
mount: Fix two memory leaks
  • Loading branch information
alexlarsson authored Jun 22, 2023
2 parents e88fde3 + ee9dd10 commit da68b13
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 da68b13

Please sign in to comment.