From d8dba632becb478df78be12d6834b79be18f3c4a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 9 Oct 2019 15:06:22 +0200 Subject: [PATCH] coverity 226322 - resourceleak --- client/emv/crypto_polarssl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/emv/crypto_polarssl.c b/client/emv/crypto_polarssl.c index b87dd9ee0..a6f69a529 100644 --- a/client/emv/crypto_polarssl.c +++ b/client/emv/crypto_polarssl.c @@ -260,6 +260,7 @@ static unsigned char *crypto_pk_polarssl_get_parameter(const struct crypto_pk *_ res = mbedtls_mpi_write_binary(&cp->ctx.N, result, *plen); if (res < 0) { printf("Error write_binary."); + free(result); result = 0; } break; @@ -271,6 +272,7 @@ static unsigned char *crypto_pk_polarssl_get_parameter(const struct crypto_pk *_ res = mbedtls_mpi_write_binary(&cp->ctx.E, result, *plen); if (res < 0) { printf("Error write_binary."); + free(result); result = 0; } break;