Skip to contentSkip to conversation

mem leak?

DISCUSSION Payphone LIOU 2 participants 2 messages Sep 1, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi, linux-nfs :

in nfs-utils1.1.3, procedure "get_exportlist()" would malloc() some memory for storing the directories and groups for "showmount". obviously those memory are not released when the procedure ends. once mountd received a signal for quiting itself(eg : kill -9 pidof mountd), it will call "killer()" for some exiting-works. but those memory allocated in "get_exportlist()" were not released. memory leak? i am not sure. :-(

Payphone LIOU

#1 lore raw
Quoted 9 lines · Payphone LIOU

Hi, linux-nfs :

in nfs-utils1.1.3, procedure "get_exportlist()" would malloc() some memory for storing the directories and groups for "showmount". obviously those memory are not released when the procedure ends. once mountd received a signal for quiting itself(eg : kill -9 pidof mountd), it will call "killer()" for some exiting-works. but those memory allocated in "get_exportlist()" were not released. memory leak? i am not sure. :-(

You're talking about the allocation done on this line?:

	e = (struct exportnode *) xmalloc(sizeof(*e));
Quoted 1 line

From a quick glance, it looks like the code tries to free that up the

next time get_exportlist() is called, in that first loop over elist. I haven't tried to figure out whether that code's correct, though; maybe you have? Patches always welcome.

--b.