diff src/tag.c @ 30061:f4a7831fa352 v9.0.0368

patch 9.0.0368: old Coverity warning for using NULL pointer Commit: https://github.com/vim/vim/commit/89083466fa565bea22832687ec5fe89a70a3b8f7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 3 12:59:19 2022 +0100 patch 9.0.0368: old Coverity warning for using NULL pointer Problem: Old Coverity warning for using NULL pointer. Solution: Bail out if dictionary allocation fails.
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Sep 2022 14:00:04 +0200
parents f5cbf8a4043d
children 0e9b58353412
line wrap: on
line diff
--- a/src/tag.c
+++ b/src/tag.c
@@ -4384,7 +4384,11 @@ get_tags(list_T *list, char_u *pat, char
 	    }
 
 	    if ((dict = dict_alloc()) == NULL)
+	    {
 		ret = FAIL;
+		vim_free(matches[i]);
+		break;
+	    }
 	    if (list_append_dict(list, dict) == FAIL)
 		ret = FAIL;