Fix a double-free bug when a window on an alternate screen queries an exec process
The 'free_it' variable was only initialised to zero at the start of the function, so when non-main screens were processed in the later iterations of the loop, it could keep a value of 1 from the previous iteration. We don't actually need a free_it variable at all - just use a NULL value of ptr_free to indicate that there is nothing to free (and passing a NULL to new_free() is a no-op). This also simplifies a test because ptr is always non-NULL (strip_ansi() never returns NULL).
This commit is contained in:
Reference in New Issue
Block a user