diff --git a/py/malloc.c b/py/malloc.c
index 6835ed7c996add31f15b13716593ce810c09424a..ba5c952f3a83e07220cde43f5c5471c54bc29ac4 100644
--- a/py/malloc.c
+++ b/py/malloc.c
@@ -117,9 +117,6 @@ void *m_malloc_with_finaliser(size_t num_bytes) {
 
 void *m_malloc0(size_t num_bytes) {
     void *ptr = m_malloc(num_bytes);
-    if (ptr == NULL && num_bytes != 0) {
-        m_malloc_fail(num_bytes);
-    }
     // If this config is set then the GC clears all memory, so we don't need to.
     #if !MICROPY_GC_CONSERVATIVE_CLEAR
     memset(ptr, 0, num_bytes);