Fix memory leak in error path; found by llvm checker

This commit is contained in:
Todd C. Miller
2013-02-06 16:38:31 -05:00
parent 11e04d30dd
commit 2d6095420a

View File

@@ -305,6 +305,7 @@ find_editor(int nfiles, char * const files[], char **argv_out[])
cp = strtok(editor, " \t");
if (cp == NULL ||
(editor_path = find_in_path(editor, plugin_state.envp)) == NULL) {
free(editor);
return NULL;
}
if (editor_path != editor)