]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Avoid a leak in xenDaemonLookupByID
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 8 Sep 2009 12:42:10 +0000 (14:42 +0200)
committerDaniel Veillard <veillard@redhat.com>
Tue, 8 Sep 2009 12:42:10 +0000 (14:42 +0200)
* src/xend_internal.c: free name in xenDaemonLookupByID() if
  virGetDomain() fails

src/xend_internal.c

index 2fa08f1b6842a05c975458fa0863e6958fba5f8a..ed6fcac1021a48360f33563f220db23091549d23 100644 (file)
@@ -3723,7 +3723,7 @@ xenDaemonLookupByID(virConnectPtr conn, int id) {
     }
 
     ret = virGetDomain(conn, name, uuid);
-    if (ret == NULL) return NULL;
+    if (ret == NULL) goto error;
 
     ret->id = id;
     VIR_FREE(name);