Browse Source

Do not set errno when they asked for size 0

Eric Andersen 22 years ago
parent
commit
1c010194a0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libc/stdlib/malloc-930716/malloc.c

+ 1 - 1
libc/stdlib/malloc-930716/malloc.c

@@ -167,7 +167,7 @@ void * __malloc_unlocked (size_t size)
 #else
     /* Some programs will call malloc (0).  Lets be strict and return NULL */
     if (unlikely(size == 0))
-	goto oom;
+	return 0
 #endif
     /* Check if they are doing something dumb like malloc(-1) */
     if (unlikely(((unsigned long)size > (unsigned long)(sizeof (struct list)*-2))))