From owner-freebsd-doc Wed Sep 25 4:40: 4 2002 Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFB6537B401 for ; Wed, 25 Sep 2002 04:40:02 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4045643E4A for ; Wed, 25 Sep 2002 04:40:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8PBe2Co010915 for ; Wed, 25 Sep 2002 04:40:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8PBe23E010914; Wed, 25 Sep 2002 04:40:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DADB337B477 for ; Wed, 25 Sep 2002 04:31:02 -0700 (PDT) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5ABA343E6A for ; Wed, 25 Sep 2002 04:31:02 -0700 (PDT) (envelope-from das@HAL9000.homeunix.com) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id g8PBV1GG068230 for ; Wed, 25 Sep 2002 04:31:01 -0700 (PDT) (envelope-from das@HAL9000.homeunix.com) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id g8PBV1bD068229; Wed, 25 Sep 2002 04:31:01 -0700 (PDT) (envelope-from das) Message-Id: <200209251131.g8PBV1bD068229@HAL9000.homeunix.com> Date: Wed, 25 Sep 2002 04:31:01 -0700 (PDT) From: David Schultz Reply-To: David Schultz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: docs/43357: PATCH: fix error in reallocf(3) manpage Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 43357 >Category: docs >Synopsis: PATCH: fix error in reallocf(3) manpage >Confidential: yes >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 25 04:40:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: David Schultz >Release: 5.0-CURRENT >Organization: >Environment: >Description: reallocf(3) is incorrectly documented as leaving the original buffer intact when an error occurs. >How-To-Repeat: >Fix: Index: malloc.3 =================================================================== RCS file: /home/ncvs/src/lib/libc/stdlib/malloc.3,v retrieving revision 1.25.2.14 diff -u -r1.25.2.14 malloc.3 --- malloc.3 2001/12/14 18:33:58 1.25.2.14 +++ malloc.3 2002/09/25 11:26:55 @@ -294,14 +294,17 @@ to the allocated memory if successful; otherwise a .Dv NULL -pointer is returned, in which case the -memory referenced by -.Fa ptr -is still available and intact. -In the case of memory allocation failure, +pointer is returned, and .Va errno is set to -.Er ENOMEM . +.Er ENOMEM +if the error was the result of an allocation failure. +The +.Fn realloc +function always leaves the original buffer intact +when an error occurs, whereas +.Fn reallocf +deallocates it in this case. .Pp The .Fn free >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message