pstree: check if thread core is allocated before freeing
It looks like, it's possible that cores for some threads were allocated, but not for all - allocation failed in pstree_alloc_cores(). And after that we will dereference NULL pointer as pstree_free_cores() doesn't check pointer: pstree.c:28:6: warning: Access to field 'tc' results in a dereference of a null pointer (loaded from variable 'core') if (core->tc && core->tc->timers) ^~~~~~~~ Signed-off-by:Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
Showing
Please
register
or
sign in
to comment