Re: [patch] getline.3: Emphasiqze that user code should free the allocated buffer even if getline() failed.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexey,

Good patch, good explanation. Applied. 

Thanks!

Cheers,

Michael



On 04/02/2014 10:30 AM, Alexey Samsonov wrote:
>>From 4a09a0da31e9b98167e974e05f13f57b53dd41c3 Mon Sep 17 00:00:00 2001
> From: Alexey Samsonov <samsonov@xxxxxxxxxx>
> Date: Wed, 2 Apr 2014 12:26:44 +0400
> Subject: [PATCH] getline.3: Emphasize that user code should free the allocated
>  buffer even if getline() failed.
> 
> ---
>  man3/getline.3 | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/man3/getline.3 b/man3/getline.3
> index 806e455..9f403a0 100644
> --- a/man3/getline.3
> +++ b/man3/getline.3
> @@ -69,8 +69,11 @@ is set to NULL and
>  .I *n
>  is set 0 before the call, then
>  .BR getline ()
> -will allocate a buffer for storing the line,
> -which should be freed by the user program.
> +will allocate a buffer for storing the line.
> +This buffer should be freed by the user program
> +even if
> +.BR getline ()
> +failed.
> 
>  Alternatively, before calling
>  .BR getline (),
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux