[PATCH] syslog() segv fix under memory shortage

Richard Henderson rth@twiddle.net
Thu Apr 15 17:07:00 GMT 2004


On Thu, Apr 15, 2004 at 08:14:03PM +0900, GOTO Masanori wrote:
> -		__libc_cleanup_push (free, buf);
> +		if (__builtin_expect(need_free, 1))
> +		  __libc_cleanup_push (free, buf);
...
> -		__libc_cleanup_pop (0);
> +		if (__builtin_expect(need_free, 1))
> +		  __libc_cleanup_pop (0);

Cleanup push/pop cannot be nested like this.
Frankly, I'm surprised this even compiles.


r~



More information about the Libc-alpha mailing list