From 94ad719cf47118069c9d840583e10ee17b5dfe50 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 14 Sep 1998 20:34:34 +0000 Subject: Add reallocf to the library. This function is simliar to realloc, but when it returns NULL to indicate failure, it will also free the memory that was passed to it, if that was non-null. This does not change the semantics of realloc. A second commit will be done to commit the conversion of those places in the code that can safely use this to avoid memory leaks when confronted with low memory situations. Beaten-to-death-but-finally-approved-in: -current --- include/stdlib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/stdlib.h b/include/stdlib.h index 960bf431ba89..a78dafa5dbf3 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -163,6 +163,7 @@ int radixsort __P((const unsigned char **, int, const unsigned char *, int sradixsort __P((const unsigned char **, int, const unsigned char *, unsigned)); long random __P((void)); +void *reallocf __P((void *, size_t)); char *realpath __P((const char *, char resolved_path[])); char *setstate __P((char *)); void srandom __P((unsigned long)); -- cgit v1.3