(edit_get_match_keyword_cmd): fix possible NULL dereference.

Found by Coverity.
Coverity id #32609.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andreas Mohr 2020-12-13 12:50:56 +00:00 committed by Andrew Borodin
parent 40b96b67dd
commit ae244077af

View File

@ -3538,7 +3538,7 @@ edit_get_match_keyword_cmd (WEdit * edit)
path = ptr;
g_free (tagfile);
tagfile = mc_build_filename (path, TAGS_NAME, (char *) NULL);
if (exist_file (tagfile))
if (tagfile != NULL && exist_file (tagfile))
break;
}
while (strcmp (path, PATH_SEP_STR) != 0);