]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Fix possible leak in virResctrlAllocMasksAssign
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 1 Feb 2018 13:19:42 +0000 (14:19 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 2 Feb 2018 13:50:12 +0000 (14:50 +0100)
Found by coverity.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/util/virresctrl.c

index e1c4998f715171e309a13dad2bf52d2071bef03f..70426199ce2041079fbe06ba576801208dc9d5fe 100644 (file)
@@ -1444,10 +1444,10 @@ virResctrlAllocMasksAssign(virResctrlInfoPtr resctrl,
 
     alloc_default = virResctrlAllocGetDefault(resctrl);
     if (!alloc_default)
-        return -1;
+        goto cleanup;
 
     if (virResctrlAllocCopyMasks(alloc, alloc_default) < 0)
-        return -1;
+        goto cleanup;
 
     for (level = 0; level < alloc->nlevels; level++) {
         virResctrlAllocPerLevelPtr a_level = alloc->levels[level];