[Skiboot] [PATCH v2 01/10] external/common: Don't leak temporary filename

Alistair Popple alistair at popple.id.au
Thu Nov 12 11:37:59 AEDT 2015


Reviewed-by: Alistair Popple <alistair at popple.id.au>

On Wed, 11 Nov 2015 15:39:55 Cyril Bur wrote:
> Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
> ---
>  external/common/arch_flash_powerpc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/external/common/arch_flash_powerpc.c b/external/common/arch_flash_powerpc.c
> index 53c14ce..0cc7107 100644
> --- a/external/common/arch_flash_powerpc.c
> +++ b/external/common/arch_flash_powerpc.c
> @@ -192,7 +192,7 @@ static struct blocklevel_device *arch_init_blocklevel(const char *file)
>  {
>  	int rc;
>  	struct blocklevel_device *new_bl = NULL;
> -	char *real_file;
> +	char *real_file = NULL;
>  
>  	if (!file) {
>  		rc = get_dev_mtd(FDT_FLASH_PATH, &real_file);
> @@ -201,6 +201,7 @@ static struct blocklevel_device *arch_init_blocklevel(const char *file)
>  	}
>  
>  	file_init_path(file ? file : real_file, NULL, &new_bl);
> +	free(real_file);
>  	return new_bl;
>  }
>  
> 



More information about the Skiboot mailing list