Skip to content

Commit 8c89d93

Browse files
committed
[piper] fix realloc bug
1 parent 65507e3 commit 8c89d93

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/piper.looper.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ arena_realloc(void* ctx, void* ptr, size_t sz)
322322
auto* header = (alloc_header*) (((char*) ptr) - sizeof(alloc_header));
323323
memcpy(&new_header->ah_bits, &header->ah_bits, header->ah_size);
324324
}
325-
return &new_header->ah_size;
325+
new_header->ah_size = sz;
326+
return &new_header->ah_bits;
326327
}
327328

328329
static void

0 commit comments

Comments
 (0)