diff src/vim9compile.c @ 22504:47e15b82dba1 v8.2.1800

patch 8.2.1800: Vim9: memory leak if "if" condition is invalid Commit: https://github.com/vim/vim/commit/dda749ce85cc07000faa86bfd2ceaecd8e4805fc Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 4 17:24:29 2020 +0200 patch 8.2.1800: Vim9: memory leak if "if" condition is invalid Problem: Vim9: memory leak if "if" condition is invalid. Solution: Free ppconst earlier.
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Oct 2020 17:30:03 +0200
parents ef8a3177edc1
children ac8c4a8b8cba
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -5721,10 +5721,10 @@ compile_if(char_u *arg, cctx_T *cctx)
 
 	// The expression results in a constant.
 	v = tv_get_bool_chk(&ppconst.pp_tv[0], &error);
+	clear_ppconst(&ppconst);
 	if (error)
 	    return NULL;
 	cctx->ctx_skip = v ? SKIP_NOT : SKIP_YES;
-	clear_ppconst(&ppconst);
     }
     else
     {