The @mem_path variable inside of get_files() is used only within
a single block. Move its declaration inside it. And also utilize
automatic memory freeing.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
int rc = -1;
size_t i;
char *uuid;
- char *mem_path = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN];
bool needsVfio = false, needsvhost = false, needsgl = false;
"rw") != 0)
goto cleanup;
} else {
+ g_autofree char *mem_path = NULL;
+
switch (shmem->model) {
case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_PLAIN:
/* until exposed, recreate qemuBuildShmemBackendMemProps */
ctl->files = virBufferContentAndReset(&buf);
cleanup:
- VIR_FREE(mem_path);
VIR_FREE(uuid);
return rc;
}