diff --git a/py/gc.c b/py/gc.c
index 7d4f4762efccccd56574e4495cb04e18d84821b9..690503d92c443e503ceb76d3ba0f82094d21195e 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -329,8 +329,10 @@ void *gc_realloc(void *ptr, machine_uint_t n_bytes) {
     if (n_bytes <= n_existing) {
         return ptr;
     } else {
+        // TODO check if we can grow inplace
         void *ptr2 = gc_alloc(n_bytes);
         memcpy(ptr2, ptr, n_existing);
+        gc_free(ptr);
         return ptr2;
     }
 }