Fixing memory leak when analyzer mode is enabled