Re: [PATCH v4 1/2] daemon: Fix domain name leak in error path

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

 



On Mon, Apr 24, 2017 at 12:05:24PM +0800, Wang King wrote:
Domain name duplicated in make_nonnull_domain, but not freed when virTypedParamsSerialize
return negative.
---
daemon/remote.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)


ACK, I just tweak the commit message and push it in a while.

diff --git a/daemon/remote.c b/daemon/remote.c
index 1610fea..a8c21fd 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -1066,8 +1066,10 @@ remoteRelayDomainEventTunable(virConnectPtr conn,
    if (virTypedParamsSerialize(params, nparams,
                                (virTypedParameterRemotePtr *) &data.params.params_val,
                                &data.params.params_len,
-                                VIR_TYPED_PARAM_STRING_OKAY) < 0)
+                                VIR_TYPED_PARAM_STRING_OKAY) < 0) {
+        VIR_FREE(data.dom.name);
        return -1;
+    }

    remoteDispatchObjectEventSend(callback->client, remoteProgram,
                                  REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TUNABLE,
@@ -1206,8 +1208,10 @@ remoteRelayDomainEventJobCompleted(virConnectPtr conn,
    if (virTypedParamsSerialize(params, nparams,
                                (virTypedParameterRemotePtr *) &data.params.params_val,
                                &data.params.params_len,
-                                VIR_TYPED_PARAM_STRING_OKAY) < 0)
+                                VIR_TYPED_PARAM_STRING_OKAY) < 0) {
+        VIR_FREE(data.dom.name);
        return -1;
+    }

    remoteDispatchObjectEventSend(callback->client, remoteProgram,
                                  REMOTE_PROC_DOMAIN_EVENT_CALLBACK_JOB_COMPLETED,
--
2.8.3

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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