On 18 Sep 2005 23:28:29 +0200, Viktor Griph wrote: > > I just believe that I didn't freeded a varable returned by expand_vars, > thus having a memory leak. Could you check so that the var_name is > freed at the end of epand_vars_extended if it isn't already?
This is not trivial, since this function has 32 "return" statements. :) I believe they may be mostly replaced with just "break", or similar. A faster fix would be to create a wrapper function, like: if (name_has_dollar) { var_name = expand_vars(var_name); should_free = 1; } expand_vars_extended(var_name); if (should_free) { free(var_name); } You may implement one or another fix when you have a time. Regards, Mikhael.