[PATCH:libX11 08/12] Avoid memory leak/corruption if realloc fails in imLcPrs.c:parseline()

Alan Coopersmith alan.coopersmith at oracle.com
Sun Aug 11 20:10:39 PDT 2013


On 08/11/13 03:30 AM, Matthieu Herrb wrote:
> On Sat, Aug 10, 2013 at 01:55:05PM -0700, Alan Coopersmith wrote:
>> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
>
> Here (and in patch 06) I'm quite sure that the old b->mb (resp. b->wc)
> should be free()'d on the error path, since we're completly
> failing if that happens.

Hmm, I wasn't so sure.   In this case, the b pointer is from the object
passed in, and it was unclear if the callers had other pointers to it.

In patch 6, since it's a static variable it's easier to track down and
see the callers currently don't check for error, but it looks like they
won't actually dereference the pointer unless the count is greater than
zero, so I'll rework that one now.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list