fix memory leak in allocExec/freeExec (see bug #985)