Skip to content

Commit

Permalink
libebgenv: fix memory leak in partition probing
Browse files Browse the repository at this point in the history
When probing partitions, the mountpoint string is allocated on the heap.
Normally the mountpoint is freed during unmounting. But for partitions
that are already mounted, we also need to free the mountpoint str.

Signed-off-by: Felix Moessbauer <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
fmoessbauer authored and jan-kiszka committed Oct 17, 2023
1 parent 261e8c2 commit c098363
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions env/env_config_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ bool probe_config_file(CONFIG_PART *cfgpart)
}
if (do_unmount) {
unmount_partition(cfgpart);
} else {
free(cfgpart->mountpoint);
}
return result;
}
Expand Down

0 comments on commit c098363

Please sign in to comment.