bug-bash
[Top][All Lists]
Advanced

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

Re: [patch] memory leak in read builtin


From: Tim Waugh
Subject: Re: [patch] memory leak in read builtin
Date: Mon, 13 Feb 2006 12:59:40 +0000
User-agent: Mutt/1.4.2.1i

Hi,

I posted two patches for memory leaks in bash-3.0.  One of them has
made it into bash-3.1, but the other has not.  Here is the missing
one:

On Wed, Dec 07, 2005 at 06:10:07PM +0000, Tim Waugh wrote:

> There is at least one memory leak in the read builtin in bash-3.0.  To
> demonstrate it, try this test case:
> 
>   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=173283#c10
> 
> There is a link to a file, nonblock.c, which you should compile like
> 'make nonblock'.  Then run the short script to see the problem.
> 
> The problem comes about when stdin has O_NONBLOCK set.  Here is the
> fix:
> 
> --- bash-3.0/builtins/read.def.read-memleak   2005-12-07 17:45:38.000000000 
> +0000
> +++ bash-3.0/builtins/read.def        2005-12-07 17:45:39.000000000 +0000
> @@ -461,6 +461,7 @@
>    if (retval < 0)
>      {
>        builtin_error (_("read error: %d: %s"), fd, strerror (errno));
> +      run_unwind_frame ("read_builtin");
>        return (EXECUTION_FAILURE);
>      }
>  #endif

Tim.
*/

Attachment: pgpdRNgLPpo7i.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]