]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
daemon: plug memory leak
authorEric Blake <eblake@redhat.com>
Mon, 6 Jun 2011 21:03:26 +0000 (15:03 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 8 Jun 2011 11:30:57 +0000 (05:30 -0600)
Detected by Coverity.  Commit ef21beda was incomplete; it solved
a leak one one path, but not on the other.

* daemon/libvirtd.c (qemudSetLogging): Avoid leak on success.

daemon/libvirtd.c

index 728031f0c2d2df37a8f5830bff83428db77d2390..bcaa37b444c590f9b070ee5b599405da8e4d3092 100644 (file)
@@ -2783,6 +2783,7 @@ qemudSetLogging(struct qemud_server *server, virConfPtr conf,
                     VIR_FREE(userdir);
                     goto out_of_memory;
                 }
+                VIR_FREE(userdir);
             }
         } else {
             if (virAsprintf(&tmp, "%d:stderr", virLogGetDefaultPriority()) < 0)