summaryrefslogtreecommitdiff
path: root/Src/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 521baf613..f3979dfc0 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -346,8 +346,10 @@ getsubsargs(char *subline, int *gbalp, int *cflagp)
if (strlen(ptr1)) {
zsfree(hsubl);
hsubl = ptr1;
- } else if (!hsubl) /* fail silently on this */
+ } else if (!hsubl) { /* fail silently on this */
+ zsfree(ptr2);
return 0;
+ }
zsfree(hsubr);
hsubr = ptr2;
follow = ingetc();