[gnutls-devel] [PATCH] Fix HANDLE_LEAK and memory leak issues.
Nikos Mavrogiannopoulos
nmav at gnutls.org
Mon Aug 22 11:26:59 CEST 2016
Applied. Thank you.
On Fri, Aug 19, 2016 at 11:58 AM, SUMIT AGGARWAL <aggarwal.s at samsung.com> wrote:
> Signed-off-by: Sumit Aggarwal <aggarwal.s at samsung.com>
> ---
> src/benchmark-cipher.c | 5 ++++-
> src/srptool.c | 2 ++
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/benchmark-cipher.c b/src/benchmark-cipher.c
> index 636ab2a..15ae615 100644
> --- a/src/benchmark-cipher.c
> +++ b/src/benchmark-cipher.c
> @@ -66,8 +66,11 @@ static void cipher_mac_bench(int algo, int mac_algo, int size)
> memset(_key, 0xf0, keysize);
>
> _iv = malloc(ivsize);
> - if (_iv == NULL)
> + if (_iv == NULL) {
> + if (_key)
> + free(_key);
> return;
> + }
> memset(_iv, 0xf0, ivsize);
>
> iv.data = _iv;
> diff --git a/src/srptool.c b/src/srptool.c
> index 5d60cde..8260f15 100644
> --- a/src/srptool.c
> +++ b/src/srptool.c
> @@ -114,11 +114,13 @@ static int generate_create_conf(const char *tpasswd_conf)
>
> if (gnutls_srp_base64_encode_alloc(&n, &str_n) < 0) {
> fprintf(stderr, "Could not encode\n");
> + fclose(fd);
> return -1;
> }
>
> if (gnutls_srp_base64_encode_alloc(&g, &str_g) < 0) {
> fprintf(stderr, "Could not encode\n");
> + fclose(fd);
> return -1;
> }
>
> --
> 1.9.1
> _______________________________________________
> Gnutls-devel mailing list
> Gnutls-devel at lists.gnutls.org
> http://lists.gnupg.org/mailman/listinfo/gnutls-devel
More information about the Gnutls-devel
mailing list