1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

* malloc/malloc.c (sYSMALLOc): Avoid infinite loop if MMAP

keeps failing and heap growth or new heap creation isn't
	successful either.
	* malloc/tst-malloc.c (main): Add new tests.
This commit is contained in:
Ulrich Drepper
2006-08-24 17:30:37 +00:00
parent 542a6f62af
commit 7463d5cb4d
3 changed files with 21 additions and 2 deletions

View File

@ -33,7 +33,7 @@ merror (const char *msg)
int
main (void)
{
void *p;
void *p, *q;
int save;
errno = 0;
@ -64,5 +64,15 @@ main (void)
if (p != NULL)
merror ("realloc (p, 0) failed.");
p = malloc (513 * 1024);
if (p == NULL)
merror ("malloc (513K) failed.");
q = malloc (-512 * 1024);
if (q != NULL)
merror ("malloc (-512K) succeeded.");
free (p);
return errors != 0;
}