about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Src/hist.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f54188af9..1b3076632 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-01-06  Mikael Magnusson  <mikachu@gmail.com>
 
+	* 34107: Src/hist.c: getsubsargs: free ptr1 before returning
+
 	* 34134: Src/exec.c: anon funcs: don't leak shf and related data
 
 	* 34112: Src/builtin.c: typeset: fix leak of oldval
diff --git a/Src/hist.c b/Src/hist.c
index d8192c1c5..e65d78bfd 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -367,6 +367,7 @@ getsubsargs(char *subline, int *gbalp, int *cflagp)
 	zsfree(hsubl);
 	hsubl = ptr1;
     } else if (!hsubl) {		/* fail silently on this */
+	zsfree(ptr1);
 	zsfree(ptr2);
 	return 0;
     }