]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Fix memory leak in virPCIProbeStubDriver
authorJohn Ferlan <jferlan@redhat.com>
Tue, 16 Jun 2020 12:07:05 +0000 (08:07 -0400)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 16 Jun 2020 13:01:06 +0000 (15:01 +0200)
Since 9ea90206, @drvpath could be overwritten if we jumped to recheck

Found by Coverity.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/util/virpci.c

index 6c7e6bbcab642df6a16e106fbb4332dc0b517c1a..786b1393e69613ff59f06aa2ccfa3d27f7b37bd9 100644 (file)
@@ -1018,6 +1018,7 @@ virPCIProbeStubDriver(virPCIStubDriver driver)
             goto cleanup;
         }
 
+        VIR_FREE(drvpath);
         goto recheck;
     }