summaryrefslogtreecommitdiff
path: root/tests/virtestmock.c
diff options
context:
space:
mode:
authorJán Tomko <jtomko@redhat.com>2021-09-04 22:37:31 +0200
committerJán Tomko <jtomko@redhat.com>2021-09-09 18:06:13 +0200
commit526551ac0a7103688cef1806341641de66ea1656 (patch)
treed0c39c6c2065748110230bfe91fbbccd79df0ca7 /tests/virtestmock.c
parent5679b6283b7f71a6536335a5bae27c2ee5fc64fc (diff)
downloadlibvirt-526551ac0a7103688cef1806341641de66ea1656.tar.gz
tests: vir: use g_autofree
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com>
Diffstat (limited to 'tests/virtestmock.c')
-rw-r--r--tests/virtestmock.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/virtestmock.c b/tests/virtestmock.c
index 0073677b4d..7951f3d00f 100644
--- a/tests/virtestmock.c
+++ b/tests/virtestmock.c
@@ -100,9 +100,9 @@ static void
checkPath(const char *path,
const char *func)
{
- char *fullPath = NULL;
- char *relPath = NULL;
- char *crippledPath = NULL;
+ g_autofree char *fullPath = NULL;
+ g_autofree char *relPath = NULL;
+ g_autofree char *crippledPath = NULL;
if (!g_path_is_absolute(path))
relPath = g_strdup_printf("./%s", path);
@@ -130,10 +130,6 @@ checkPath(const char *path,
printFile(path, func);
}
- VIR_FREE(crippledPath);
- VIR_FREE(relPath);
- VIR_FREE(fullPath);
-
return;
}