[PATCH] lib: fwts_klog: remove redundant free()

Alex Hung alex.hung at canonical.com
Fri Mar 9 01:58:51 UTC 2012


On 03/08/2012 08:48 PM, Colin King wrote:
> From: Colin Ian King<colin.king at canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king at canonical.com>
> ---
>   src/lib/src/fwts_klog.c |    4 +---
>   1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c
> index 39e8183..7b7fb41 100644
> --- a/src/lib/src/fwts_klog.c
> +++ b/src/lib/src/fwts_klog.c
> @@ -66,10 +66,8 @@ fwts_list *fwts_klog_read(void)
>   	if ((len = klogctl(10, NULL, 0))<  0)
>   		return NULL;
>
> -	if ((buffer = calloc(1, len)) == NULL) {
> -		free(buffer);
> +	if ((buffer = calloc(1, len)) == NULL)
>   		return NULL;
> -	}
>   	
>   	if (klogctl(3, buffer, len)<  0) {
>   		free(buffer);
Acked-by: Alex Hung <alex.hung at canonical.com>




More information about the fwts-devel mailing list