Skip to contentSkip to conversation

libmultipath: fix memory API logic error

PATCH Xose Vazquez Perez 2 participants 2 messages Aug 15, 2016 Device mapper

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines · tang.junhui

Memroy API use mem_allocated to record the total size of used memory, however, it's wrong to use size(p) as the length of freed memory in xfree(), and memory may also be allocated by STRDUP() or REALLOC(), which is not calculated into mem_allocated, so the total size of used memory is not correctly. For these reasons, we removed these incorrectly code to keep the code clean.

 libmpathpersist/mpath_updatepr.c |  1 -
 libmultipath/memory.c            | 31 -------------------------------
 libmultipath/memory.h            | 13 ++-----------

libmultipath/memory.[ch] files along with libmultipath/parser.[ch] and libmultipath/vector.[ch] come from keepalived/lib/ [1] .

Maybe it's worth to backport their fixes and new features.

[1] https://github.com/acassen/keepalived

#1 lore raw
Quoted 4 lines · Xose Vazquez Perez

libmultipath/memory.[ch] files along with libmultipath/parser.[ch] and libmultipath/vector.[ch] come from keepalived/lib/ [1] .

Maybe it's worth to backport their fixes and new features.

Hello Xose,

Are you aware that there are tools available that are much more powerful than keepalived's memory.[ch]? See e.g.
http://valgrind.org/info/tools.html#massif.

Bart.