* runtime/memory.c (allocate_size): Malloc 1 byte if size == 0.

From-SVN: r104909
This commit is contained in:
Jakub Jelinek 2005-10-03 22:32:44 +02:00 committed by Jakub Jelinek
parent 01406f868c
commit bb13c3502b
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2005-10-03 Jakub Jelinek <jakub@redhat.com>
* runtime/memory.c (allocate_size): Malloc 1 byte if size == 0.
2005-10-03 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/19308

View File

@ -182,7 +182,7 @@ allocate_size (void **mem, size_t size, GFC_INTEGER_4 * stat)
if (!mem)
runtime_error ("Internal: NULL mem pointer in ALLOCATE.");
newmem = malloc (size);
newmem = malloc (size ? size : 1);
if (!newmem)
{
if (stat)