fix memory leak regression from removing nested functions
fix memory leak regression from removing nested functions

pombredanne/discodb,goller/discodb,discoproject/discodb,goller/discodb,pombredanne/discodb,discoproject/discodb