libpciaccess: Changes to 'master'
Daniel Drake
dsd at kemper.freedesktop.org
Mon Nov 28 06:35:28 PST 2011
src/common_io.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
New commits:
commit a798395a1bfd9d06d40e2d8d14377a156c94429a
Author: Daniel Drake <dsd at laptop.org>
Date: Fri Nov 25 12:28:48 2011 -0600
delete_io_handle: fix deletion of last handle
When num_ios goes from 1 to 0, a realloc(ios, 0); call is made.
This is equivalent to free(ios) and NULL is returned.
However, the previous logic in the code incorrectly discards this NULL
return value. When we next call new_io_handle(), realloc(ios, X) is
called with "ios" pointing to freed memory. This causes glibc to abort.
Correct this logic to detect the 1-to-0 case and handle it correctly.
Other cases are unchanged; there is still value in checking the
return value from realloc() as it also returns NULL on error.
Signed-off-by: Daniel Drake <dsd at laptop.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
More information about the xorg-commit
mailing list