[PATCH v1 08/34] qemuDomainAttachDeviceMknodHelper: Don't leak data->target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_domain_namespace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namespace.c
index 6bd1fb30cf..e385cda64a 100644
--- a/src/qemu/qemu_domain_namespace.c
+++ b/src/qemu/qemu_domain_namespace.c
@@ -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;
 }
 
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux