coverity 226322 - resourceleak

This commit is contained in:
iceman1001 2019-10-09 15:06:22 +02:00
parent 0556c83570
commit d8dba632be

View file

@ -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); res = mbedtls_mpi_write_binary(&cp->ctx.N, result, *plen);
if (res < 0) { if (res < 0) {
printf("Error write_binary."); printf("Error write_binary.");
free(result);
result = 0; result = 0;
} }
break; 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); res = mbedtls_mpi_write_binary(&cp->ctx.E, result, *plen);
if (res < 0) { if (res < 0) {
printf("Error write_binary."); printf("Error write_binary.");
free(result);
result = 0; result = 0;
} }
break; break;