From b62584cbcd7dbbb740b9420e37f34ee1b2e8ff18 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Wed, 10 Sep 2008 19:02:11 +0000 Subject: 25639: free ptr2 if hsubl is NULL. --- ChangeLog | 2 ++ Src/hist.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c7749ba10..62885ed36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-09-10 Clint Adams + * 25639: Src/hist.c: free ptr2 if hsubl is NULL. + * 25638: Src/Zle/compmatch.c: remove unnecessary ternary expression in match_str. 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(); -- cgit 1.4.1