Fix potential memory leak in VAS implementation

This commit is contained in:
kormax committed 2023-07-10 10:34:08 +03:00
1 parent d5b77d2546
commit abd2f759ae
1 file changed
+2 -2
+2 -2
View File
@@ -187,10 +187,9 @@ static int LoadReaderPrivateKey(uint8_t *buf, size_t bufLen, mbedtls_ecp_keypair
return PM3_EINVARG;
}
tlvdb_free(derRoot);
if (mbedtls_ecp_point_read_binary(&privKey->grp, &privKey->Q, pubkeyCoordsTlv->value + 1, 65)) {
PrintAndLogEx(FAILED, "Failed to read in public key coordinates");
tlvdb_free(derRoot);
return PM3_EINVARG;
}
@@ -199,6 +198,7 @@ static int LoadReaderPrivateKey(uint8_t *buf, size_t bufLen, mbedtls_ecp_keypair
return PM3_EINVARG;
}
tlvdb_free(derRoot);
return PM3_SUCCESS;
}