From acb13517556f8a34e5ef3426d686375ddc8d46fd Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sun, 13 Dec 2020 12:50:56 +0000
Subject: [PATCH] (editcmd.c) fix dereference before null check
Fix dereference before null check
Found by Coverity
Coverity id #32609
Coverity id #313667
Signed-off-by: Andreas Mohr <and@gmx.li>
---
src/editor/editcmd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
index 3fec8cd97..27d7bff99 100644
a
|
b
|
edit_get_match_keyword_cmd (WEdit * edit) |
3538 | 3538 | path = ptr; |
3539 | 3539 | g_free (tagfile); |
3540 | 3540 | tagfile = mc_build_filename (path, TAGS_NAME, (char *) NULL); |
3541 | | if (exist_file (tagfile)) |
| 3541 | if (tagfile != NULL && exist_file (tagfile)) |
3542 | 3542 | break; |
3543 | 3543 | } |
3544 | 3544 | while (strcmp (path, PATH_SEP_STR) != 0); |
… |
… |
edit_suggest_current_word (WEdit * edit) |
3630 | 3630 | edit_insert (edit, *new_word); |
3631 | 3631 | g_free (cp_word); |
3632 | 3632 | } |
3633 | | else if (retval == B_ADD_WORD && match_word != NULL) |
| 3633 | else if (retval == B_ADD_WORD) |
3634 | 3634 | aspell_add_to_dict (match_word->str, (int) word_len); |
3635 | 3635 | } |
3636 | 3636 | |