Fix potential memory leak in VAS implementation
This commit is contained in:
1 parent
d5b77d2546
commit
abd2f759ae
1 file changed
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user