diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-27 10:06:42 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-02-05 18:30:10 -0800 |
commit | f4a9332ad149ed15353a9c482563bdd042d0b403 (patch) | |
tree | f66560b446886d4b202ab3e8e644ad5cadde768b /composite/compext.c | |
parent | 7fe5e6dfa5c1e71d8b7540b28c1d508687a2fbee (diff) |
Handle failure to create counter in init_system_idle_counter
Check for NULL pointer (which can be returned for multiple reasons)
before trying to dereference it to add privates. To avoid memory leak
in error path, delay malloc of privates until we're ready to add them.
In case we do return NULL up through SyncInitDeviceIdleTime, handle the
possibility of getting NULL passed back down to SyncRemoveDeviceIdleTime.
As reported by parfait 1.1:
Error: Null pointer dereference (CWE 476)
Read from null pointer 'idle_time_counter'
at line 2764 of xserver/Xext/sync.c in function 'init_system_idle_counter'.
Function 'SyncCreateSystemCounter' may return constant 'NULL' at line 952, called at line 2756.
Null pointer introduced at line 952 in function 'SyncCreateSystemCounter'.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'composite/compext.c')
0 files changed, 0 insertions, 0 deletions