Re: [PATCH 13/34] libmount: fix memory leak [clang-analyzer]

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

 



On Sun, Jul 07, 2013 at 08:54:28PM +0100, Sami Kerola wrote:
> Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
> ---
>  libmount/src/utils.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libmount/src/utils.c b/libmount/src/utils.c
> index 1655764..7714b50 100644
> --- a/libmount/src/utils.c
> +++ b/libmount/src/utils.c
> @@ -198,6 +198,7 @@ int mnt_chdir_to_parent(const char *target, char **filename)
>  		else
>  			memcpy(*filename, last, strlen(last) + 1);
>  	}
    else

> +	free(buf);
>  	return 0;

 Please, read the code and don't blindly follow analyzers.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux