[PATCH] Fix segfault and memory issues in infostore.c
<epg <at> pretzelnet.org>
2012-04-14 07:32:43 GMT
Hi, fvwm-workers; long time no see! GNOME 3 / Unity have ended my
4-year fling and sent me crawling back; I always come back to fvwm, in
the end :)
I found a segfault when polishing up and modernizing my config, and
then found a few much more minor memory issues.
The first patch should be non-controversial; the only reason it works
at all in some cases is that the mi_store is NULL after the memset
(and also writing zeros over some other random memory), and
mi_new->next becomes NULL on the first item being stored.
Author: epg <epg <at> pretzelnet.org>
Date: Fri Apr 13 22:06:51 2012 -0700
Fix segfault in new_metainfo:
Need to memset the newly allocated block of memory at the address held in
mi_store, not the stack memory holding that address.
The second fixes various memory leaks I found; the latest one is only
an issue after the above fix (as mi_store is now pointing to a dead
object during initialization rather than a NULL pointer).
commit a297778dede814070ddbba7da8ab7d992fddcc9e
Author: epg <epg <at> pretzelnet.org>
Date: Fri Apr 13 22:28:11 2012 -0700
Don't keep a dead MetaInfo entry at the end of the list.
(Continue reading)