some more, small memory management fixes

Lubomir I. Ivanov neolit123 at gmail.com
Fri Dec 28 05:43:01 PST 2012


the first one [1/3] is based on the following discussion and is an improvement
of a previous patch:
http://lists.hohndel.org/pipermail/subsurface/2012-December/001998.html

[2/3] is a small fix

[3/3] this one fixes a potential seg. fault by adding more space for a buffer,
holding a c-format, translated string.

[PATCH 1/3] Don't allocate an intermediate buffer for most parsed
[PATCH 2/3] Free trip notes memory when deleting a trip
[PATCH 3/3] Added some extra space for the "or" word when merging

----
i'm seeing another memory leak related to trips when importing test23.xml,
multiple times, but can find a good/correct solution ATM.

prase-xml.c:trip_start(), always allocates one dive_trip_t
struct and then divelist.c:insert_trip() decides if this trip will be added or
combined with an already existing trip from the current list.

but this looks like we are overriding a heap pointer:
*dive_trip_p = trip;
hm, may have to look at this again...

lubomir
--


More information about the subsurface mailing list