We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d398576 commit 51ecdebCopy full SHA for 51ecdeb
client/src/loclass/ikeys.c
@@ -562,7 +562,15 @@ void invert_hash0(uint8_t k[8]) {
562
563
// Create new forks by duplicating existing uint64_t values
564
int new_head = heads_count * 2;
565
- hydra_heads = (uint64_t *)realloc(hydra_heads, new_head * sizeof(uint64_t));
+
566
+ // proper realloc pattern
567
+ uint64_t *ptmp = (uint64_t *)realloc(hydra_heads, new_head * sizeof(uint64_t));
568
+ if (ptmp == NULL) {
569
+ PrintAndLogEx(FAILED, "failed to allocate memory");
570
+ free(hydra_heads);
571
+ return;
572
+ }
573
+ hydra_heads = ptmp;
574
575
// Duplicate all current values and add the value to both original and new ones
576
for (int i = 0; i < heads_count; i++) {
0 commit comments