From 80cb604cc86753e814d3015532be7351d61098e7 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 7 Mar 2014 15:27:05 -0300 Subject: [PATCH] Fix memory leak in `eval7` --- src/eval.c | 2 +- src/testdir/Makefile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/eval.c b/src/eval.c index 9630976056..aeda008129 100644 --- a/src/eval.c +++ b/src/eval.c @@ -4515,7 +4515,7 @@ eval7 ( * get_func_tv, but it's needed in handle_subscript() to parse * what follows. So set it here. */ if (rettv->v_type == VAR_UNKNOWN && !evaluate && **arg == '(') { - rettv->vval.v_string = vim_strsave((char_u *)""); + rettv->vval.v_string = (char_u *)""; rettv->v_type = VAR_FUNC; } diff --git a/src/testdir/Makefile b/src/testdir/Makefile index 5477194300..6605a0f049 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -27,8 +27,12 @@ SCRIPTS := test1.out test2.out test3.out test4.out test5.out test6.out \ SCRIPTS_GUI := test16.out +ifdef VALGRIND_GDB +VGDB := --vgdb=yes --vgdb-error=0 +endif + ifdef VALGRIND_CHECK -VALGRIND = valgrind --suppressions=../../.valgrind.supp --leak-check=full --error-exitcode=123 --log-file=valgrind.$* +VALGRIND = valgrind --suppressions=../../.valgrind.supp --leak-check=full --error-exitcode=123 --log-file=valgrind.$* $(VGDB) endif ifdef TESTNUM