Skip to content

Commit 7f7ee75

Browse files
committed
Patch util.c
1 parent e76b8da commit 7f7ee75

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/util.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,11 @@ void janet_registry_put(
429429
if (newcap < 512) {
430430
newcap = 512;
431431
}
432-
janet_vm.registry = janet_realloc(janet_vm.registry, newcap * sizeof(JanetCFunRegistry));
433-
if (NULL == janet_vm.registry) {
432+
void *newmem = janet_realloc(janet_vm.registry, newcap * sizeof(JanetCFunRegistry));
433+
if (NULL == newmem) {
434434
JANET_OUT_OF_MEMORY;
435435
}
436+
janet_vm.registry = newmem;
436437
janet_vm.registry_cap = newcap;
437438
}
438439
JanetCFunRegistry value = {

0 commit comments

Comments
 (0)