Date: Wed, 25 Sep 2002 04:31:01 -0700 (PDT) From: David Schultz <dschultz@uclink.Berkeley.EDU> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/43357: PATCH: fix error in reallocf(3) manpage Message-ID: <200209251131.g8PBV1bD068229@HAL9000.homeunix.com>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209251131.g8PBV1bD068229>