summaryrefslogtreecommitdiff
path: root/libgfortran/runtime/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/runtime/memory.c')
-rw-r--r--libgfortran/runtime/memory.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgfortran/runtime/memory.c b/libgfortran/runtime/memory.c
index 5f710849e52..a26d9e59efa 100644
--- a/libgfortran/runtime/memory.c
+++ b/libgfortran/runtime/memory.c
@@ -54,8 +54,8 @@ get_mem (size_t n)
void *
internal_malloc_size (size_t size)
{
- if (size == 0)
- return NULL;
+ if (unlikely (size == 0))
+ size = 1;
return get_mem (size);
}