summaryrefslogtreecommitdiffstats
path: root/qemu-img.c
diff options
context:
space:
mode:
authorMax Reitz2019-02-01 20:29:14 +0100
committerMax Reitz2019-02-25 15:11:26 +0100
commit645ae7d88e5393a2a67ebe325f4456ecd49e33e5 (patch)
tree06df9097a4763481a1e9456a70c2c58c9a8730c2 /qemu-img.c
parentblock: Make path_combine() return the path (diff)
downloadqemu-645ae7d88e5393a2a67ebe325f4456ecd49e33e5.tar.gz
qemu-645ae7d88e5393a2a67ebe325f4456ecd49e33e5.tar.xz
qemu-645ae7d88e5393a2a67ebe325f4456ecd49e33e5.zip
block: bdrv_get_full_backing_filename_from_...'s ret. val.
Make bdrv_get_full_backing_filename_from_filename() return an allocated string instead of placing the result in a caller-provided buffer. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190201192935.18394-11-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/qemu-img.c b/qemu-img.c
index d2fc28c987..ae0025926c 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3343,18 +3343,14 @@ static int img_rebase(int argc, char **argv)
bdrv_refresh_filename(bs);
overlay_filename = bs->exact_filename[0] ? bs->exact_filename
: bs->filename;
- out_real_path = g_malloc(PATH_MAX);
-
- bdrv_get_full_backing_filename_from_filename(overlay_filename,
- out_baseimg,
- out_real_path,
- PATH_MAX,
- &local_err);
+ out_real_path =
+ bdrv_get_full_backing_filename_from_filename(overlay_filename,
+ out_baseimg,
+ &local_err);
if (local_err) {
error_reportf_err(local_err,
"Could not resolve backing filename: ");
ret = -1;
- g_free(out_real_path);
goto out;
}