[flashrom] [PATCH] CID1130006: Resource leak

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Sat Apr 26 20:30:14 CEST 2014


On Tue, 19 Nov 2013 20:35:57 +0100
Stefan Reinauer <stefan.reinauer at coreboot.org> wrote:

> CID1130006: Resource leak
> 
> The system resource will not be reclaimed and reused, reducing the future
> availability of the resource.
> In buspirate_spi_init: Leak of memory or pointers to system resources
> 
> Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
> 
> Index: buspirate_spi.c
> ===================================================================
> --- buspirate_spi.c	(revision 1763)
> +++ buspirate_spi.c	(working copy)
> @@ -250,6 +250,7 @@
>  	if (!bp_commbuf) {
>  		bp_commbufsize = 0;
>  		msg_perr("Out of memory!\n");
> +		free(dev);
>  		return ERROR_OOM;
>  	}
>  	bp_commbufsize = DEFAULT_BUFSIZE;

Right, thanks.
Coverity seems to have missed another leak in case register_shutdown()
fails a few lines below this one. I have added my fix for that and
committed them in r1778.
-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner




More information about the flashrom mailing list