Merge pull request #1304 from slluis/mac-proxy-autoconfig
[mono.git] / mono / utils / mono-codeman.c
index 9ad7723f48afe339e81bfd3035adf686e5f00be3..5c2a83b118965861560e3b60e89874c61c96e2e4 100644 (file)
@@ -547,9 +547,10 @@ new_codechunk (CodeChunk *last, int dynamic, int size)
                        return NULL;
        } else {
                /* Try to allocate code chunks next to each other to help the VM */
+               ptr = NULL;
                if (last)
                        ptr = codechunk_valloc ((guint8*)last->data + last->size, chunk_size);
-               else
+               if (!ptr)
                        ptr = codechunk_valloc (NULL, chunk_size);
                if (!ptr)
                        return NULL;