From owner-cvs-all Mon Sep 14 13:34:38 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA12397 for cvs-all-outgoing; Mon, 14 Sep 1998 13:34:38 -0700 (PDT) (envelope-from owner-cvs-all) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA12392; Mon, 14 Sep 1998 13:34:36 -0700 (PDT) (envelope-from imp@FreeBSD.org) From: Warner Losh Received: (from imp@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id NAA07648; Mon, 14 Sep 1998 13:34:35 -0700 (PDT) Date: Mon, 14 Sep 1998 13:34:35 -0700 (PDT) Message-Id: <199809142034.NAA07648@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: cvs commit: src/include stdlib.h src/lib/libc/stdlib reallocf.c Makefile.inc malloc.3 Sender: owner-cvs-all@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk imp 1998/09/14 13:34:34 PDT Modified files: include stdlib.h lib/libc/stdlib Makefile.inc malloc.3 Added files: lib/libc/stdlib reallocf.c Log: 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 Revision Changes Path 1.14 +1 -0 src/include/stdlib.h 1.16 +3 -3 src/lib/libc/stdlib/Makefile.inc 1.16 +27 -10 src/lib/libc/stdlib/malloc.3