From: Michal Privoznik Date: Mon, 20 Jul 2020 16:54:34 +0000 (+0200) Subject: qemuDomainAttachDeviceMknodHelper: Don't leak data->target X-Git-Tag: v6.7.0-rc1~198 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=759921d47ca81a05419d2d92c906b7365a133135;p=thirdparty%2Flibvirt.git qemuDomainAttachDeviceMknodHelper: Don't leak data->target 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 Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index 063e11bb6d..db38bc0e0d 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_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; }