]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainAttachDeviceMknodHelper: Don't leak data->target
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 20 Jul 2020 16:54:34 +0000 (18:54 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 3 Aug 2020 17:40:35 +0000 (19:40 +0200)
It's not really a problem since this is a helper process that
dies as soon as the helper function returns, but the cleanup code
will be replaced with a function soon and this change prepares
the code for that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_namespace.c

index 063e11bb6d2dbea32a0dd66f99ebf9c6d579f60f..db38bc0e0de6c0c009a05a0bc28d7e653343be77 100644 (file)
@@ -1102,7 +1102,7 @@ struct qemuDomainAttachDeviceMknodData {
     virQEMUDriverPtr driver;
     virDomainObjPtr vm;
     const char *file;
-    const char *target;
+    char *target;
     GStatBuf sb;
     void *acl;
 #ifdef WITH_SELINUX
@@ -1248,6 +1248,7 @@ qemuDomainAttachDeviceMknodHelper(pid_t pid G_GNUC_UNUSED,
     freecon(data->tcon);
 # endif
     virFileFreeACLs(&data->acl);
+    VIR_FREE(data->target);
     return ret;
 }