All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Alexey Samsonov <samsonov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [patch] getline.3: Emphasiqze that user code should free the allocated buffer even if getline() failed.
Date: Wed, 02 Apr 2014 12:10:23 +0200	[thread overview]
Message-ID: <533BE20F.7070302@gmail.com> (raw)
In-Reply-To: <CAGSYnCNRKxShgzR=WCLOd4BB_4CqEScNsmk-81eytih84cx9gA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2014-04-02 10:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02  8:30 [patch] getline.3: Emphasize that user code should free the allocated buffer even if getline() failed Alexey Samsonov
     [not found] ` <CAGSYnCNRKxShgzR=WCLOd4BB_4CqEScNsmk-81eytih84cx9gA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-02 10:10   ` Michael Kerrisk (man-pages) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533BE20F.7070302@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=samsonov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.