Re: [PATCH 4/9] util: Fix memory leak in virPCIProbeStubDriver

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

 



On Tue, Jun 16, 2020 at 08:07:05 -0400, John Ferlan wrote:
> Since 9ea90206, @drvpath could be overwritten if we jumped to recheck
> 
> Found by Coverity.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/util/virpci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/util/virpci.c b/src/util/virpci.c
> index 6c7e6bbcab..16936c4be9 100644
> --- a/src/util/virpci.c
> +++ b/src/util/virpci.c
> @@ -1018,6 +1018,7 @@ virPCIProbeStubDriver(virPCIStubDriver driver)
>              goto cleanup;
>          }
>  
> +        g_free(drvpath);

The variable is reused so please use VIR_FREE as g_free doesn't clear
the pointer.

>          goto recheck;
>      }
>  
> -- 
> 2.25.4
> 




[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