aboutsummaryrefslogtreecommitdiff
path: root/spawn.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-30 09:08:03 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-30 09:08:03 +0000
commit00083125a12bc8809f5b6d498a85a880e268cc81 (patch)
tree5323673219551829fa8f95281bb782c6867fc286 /spawn.c
parentMerge branch 'revert-remove-consumed-modifiers-from-set-sent-to-client' (diff)
sixel: fix double free caused by bad free() in sixel_colors_set()
sixel_color_set() is called when the number of (sixel) color registers is changed. It frees the current palette, and changes the “palette size” variable. Originally, we only had a single palette. This is the one free:d by sixel_color_set(). Later, we added support for private vs. shared palettes. With this change, we now have one palette that is “never” free:d (the shared one), and a private palette that is always free:d after a sixel has been emitted. ‘sixel.palette’ is a pointer to the palette currently in use, and should only be accessed **while emitting a sixel**. This is the pointer sixel_color_set() free:d. So for example, if ‘sixel.palette’ pointed to the shared palette, we’d free the shared palette. But, we didn’t reset ‘sixel.shared_palette’, causing a double free later on. Closes #427
Diffstat (limited to 'spawn.c')
0 files changed, 0 insertions, 0 deletions