fix resource leak

This commit is contained in:
iceman1001 committed 2021-10-10 19:01:49 +02:00
1 parent d782788e5b
commit 2c72763a5a
2 files changed
+12 -3

No files matched your search

+2 -1
View File
@@ -454,13 +454,14 @@ static int CmdrevengSearch(const char *Cmd) {
memset(result, 0, 30);
char *inCRC = calloc(crcChars + 1, sizeof(char));
if (inCRC == NULL) {
return 0;
return 0;
}
memcpy(inCRC, inHexStr + (dataLen - crcChars), crcChars);
char *outHex = calloc(dataLen - crcChars + 1, sizeof(char));
if (outHex == NULL) {
free(inCRC);
return 0;
}