From f61037a0b04616f40f5c849a5f590232f3cff235 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sun, 6 Apr 2014 09:55:49 -0700 Subject: 32531: fix memory leaks detected by valgrind --- Src/Zle/zle_refresh.c | 3 +++ Src/Zle/zle_tricky.c | 1 + 2 files changed, 4 insertions(+) (limited to 'Src/Zle') diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index 8ce678756..80be27f03 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -444,6 +444,7 @@ void set_region_highlight(UNUSED(Param pm), char **aval) { int len; + char **av = aval; struct region_highlight *rhp; len = aval ? arrlen(aval) : 0; @@ -490,6 +491,8 @@ set_region_highlight(UNUSED(Param pm), char **aval) match_highlight(strp, &rhp->atr); } + + freearray(av); } diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 3c7cff9c1..b916bd653 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -2795,6 +2795,7 @@ doexpandhist(void) if (!err) { zlemetacs = excs; if (strcmp(zlemetaline, ol)) { + zle_restore_positions(); unmetafy_line(); /* For vi mode -- reset the beginning-of-insertion pointer * * to the beginning of the line. This seems a little silly, * -- cgit 1.4.1