[bugs:#2730] back out original patch
[bugs:#2730] redo: More memory leaks in backend/cimxml/grammer.c