From das@HAL9000.homeunix.com  Wed Sep 25 04:31:05 2002
Return-Path: <das@HAL9000.homeunix.com>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DADB337B477
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <dschultz@uclink.Berkeley.EDU>
Reply-To: David Schultz <dschultz@uclink.Berkeley.EDU>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: PATCH: fix error in reallocf(3) manpage
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         43357
>Category:       docs
>Synopsis:       PATCH: fix error in reallocf(3) manpage
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    trhodes
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 25 04:40:01 PDT 2002
>Closed-Date:    Fri Dec 20 10:25:26 PST 2002
>Last-Modified:  Fri Dec 20 10:25:26 PST 2002
>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:
State-Changed-From-To: open->patched 
State-Changed-By: trhodes 
State-Changed-When: Thu Dec 19 17:01:55 PST 2002 
State-Changed-Why:  
Patched in current!  Thanks for the submission! 


Responsible-Changed-From-To: freebsd-doc->trhodes 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Thu Dec 19 17:01:55 PST 2002 
Responsible-Changed-Why:  
Patched in current!  Thanks for the submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43357 
State-Changed-From-To: patched->closed 
State-Changed-By: trhodes 
State-Changed-When: Fri Dec 20 10:23:03 PST 2002 
State-Changed-Why:  
MFC Complete!  Thanks for the submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43357 
>Unformatted:
