restore previous revision -- memory leak should be fixed in mem.c