wview: remove view from lookup table in destroyView before freeing — fix use-after-free race
This commit is contained in:
parent
7fcfb0870d
commit
03fa233ff7
|
|
@ -318,6 +318,11 @@ static void destroyView(W_View * view)
|
|||
return;
|
||||
view->flags.alreadyDead = 1;
|
||||
|
||||
/* Remove from view lookup table before freeing memory.
|
||||
* Otherwise a concurrent W_GetViewForWindow can return a
|
||||
* dangling pointer after wfree(view) reuses the memory. */
|
||||
view_table_remove(view->window);
|
||||
|
||||
/* delete the balloon text for the view, if there's any */
|
||||
WMSetBalloonTextForView(NULL, view);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue