mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
btrfs: fix leak in btrfs_minimum_size
Make sure the result of sysroot_path is properly free'd.
This commit is contained in:
@@ -2230,7 +2230,7 @@ test_btrfs_min_dev_size (void)
|
||||
int64_t
|
||||
btrfs_minimum_size (const char *path)
|
||||
{
|
||||
CLEANUP_FREE char *err = NULL, *out = NULL;
|
||||
CLEANUP_FREE char *buf = NULL, *err = NULL, *out = NULL;
|
||||
int64_t ret = 0;
|
||||
int r;
|
||||
int min_size_supported = test_btrfs_min_dev_size ();
|
||||
@@ -2241,8 +2241,9 @@ btrfs_minimum_size (const char *path)
|
||||
NOT_SUPPORTED (-1, "'btrfs inspect-internal min-dev-size' "
|
||||
"needs btrfs-progs >= 4.2");
|
||||
|
||||
buf = sysroot_path (path);
|
||||
r = command (&out, &err, str_btrfs, "inspect-internal",
|
||||
"min-dev-size", sysroot_path (path), NULL);
|
||||
"min-dev-size", buf, NULL);
|
||||
|
||||
if (r == -1) {
|
||||
reply_with_error ("%s", err);
|
||||
|
||||
Reference in New Issue
Block a user