Skip to content

Commit

Permalink
hw/9pfs: use g_autofree in v9fs_walk() where possible
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cschoenebeck committed Aug 20, 2021
1 parent 7772715 commit 838b55e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hw/9pfs/9p.c
Expand Up @@ -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;
Expand Down Expand Up @@ -1872,8 +1873,6 @@ static void coroutine_fn v9fs_walk(void *opaque)
v9fs_path_free(&pathes[name_idx]);
}
g_free(wnames);
g_free(qids);
g_free(stbufs);
g_free(pathes);
}
}
Expand Down

0 comments on commit 838b55e

Please sign in to comment.