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 67ee6e9 commit 8692a72Copy full SHA for 8692a72
graalpython/com.oracle.graal.python.cext/src/obmalloc.c
@@ -193,7 +193,7 @@ void* PyMem_RawRealloc(void *ptr, size_t new_size) {
193
mem_head_t* old;
194
195
if (ptr != NULL) {
196
- ptr = AS_MEM_HEAD(ptr);
+ old = AS_MEM_HEAD(ptr);
197
198
// account for the difference in size
199
if (old->size >= new_size) {
@@ -203,6 +203,8 @@ void* PyMem_RawRealloc(void *ptr, size_t new_size) {
203
return NULL;
204
}
205
206
+ } else {
207
+ old = NULL;
208
209
210
mem_head_t* ptr_with_head = (mem_head_t*) realloc(old, new_size + sizeof(mem_head_t));
0 commit comments