aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorChristian Schoenebeck <qemu_oss@crudebyte.com>2021-08-17 15:46:50 +0200
committerChristian Schoenebeck <qemu_oss@crudebyte.com>2021-09-02 13:26:22 +0200
commit869605b5a076e231ae36c54866f348b9bdf18f76 (patch)
tree17a60ab0020c121e374497b78e3cab0d40387400 /hw
parent97b1d8fdf6c923203968f44805e25dc92b11a317 (diff)
downloadqemu-869605b5a076e231ae36c54866f348b9bdf18f76.zip
qemu-869605b5a076e231ae36c54866f348b9bdf18f76.tar.gz
qemu-869605b5a076e231ae36c54866f348b9bdf18f76.tar.bz2
hw/9pfs: use g_autofree in v9fs_walk() where possible
Suggested-by: Greg Kurz <groug@kaod.org> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <b51670d2a39399535a035f6bc77c3cbeed85edae.1629208359.git.qemu_oss@crudebyte.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/9pfs/9p.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 4d642ab..c857b31 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -1703,11 +1703,12 @@ static bool same_stat_id(const struct stat *a, const struct stat *b)
static void coroutine_fn v9fs_walk(void *opaque)
{
int name_idx;
- V9fsQID *qids = NULL;
+ g_autofree V9fsQID *qids = NULL;
int i, err = 0;
V9fsPath dpath, path, *pathes = NULL;
uint16_t nwnames;
- struct stat stbuf, fidst, *stbufs = NULL;
+ struct stat stbuf, fidst;
+ g_autofree struct stat *stbufs = NULL;
size_t offset = 7;
int32_t fid, newfid;
V9fsString *wnames = NULL;
@@ -1872,8 +1873,6 @@ out_nofid:
v9fs_path_free(&pathes[name_idx]);
}
g_free(wnames);
- g_free(qids);
- g_free(stbufs);
g_free(pathes);
}
}