free memory at end of exec