cppcheck: a few mem alloc checks

This commit is contained in:
Philippe Teuwen committed 2025-03-24 10:44:01 +01:00
1 parent f3367e61db
commit 678b387c3f
8 files changed
+37

No files matched your search

+4
View File
@@ -114,6 +114,10 @@ static int CreateGetVASDataCommand(const uint8_t *pidHash, const char *url, size
size_t reqTlvLen = 19 + (pidHash != NULL ? 35 : 0) + (url != NULL ? 3 + urlLen : 0);
uint8_t *reqTlv = calloc(reqTlvLen, sizeof(uint8_t));
if (reqTlv == NULL) {
PrintAndLogEx(FAILED, "Memory allocation failed");
return PM3_EMALLOC;
}
uint8_t version[] = {0x9F, 0x22, 0x02, 0x01, 0x00};
memcpy(reqTlv, version, sizeof(version));