From a5b015ab7e593f8f421f494043d3ba2237ae1e2c Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Thu, 30 Jul 2009 12:40:13 +0200 Subject: [PATCH] Make sure av is freed if its allocated [CID-73] --- lib/editline/editline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/editline/editline.c b/lib/editline/editline.c index c371393a8..f02bf51e5 100644 --- a/lib/editline/editline.c +++ b/lib/editline/editline.c @@ -1301,7 +1301,7 @@ argify(unsigned char *line, unsigned char ***avp) static el_STATUS last_argument(void) { - unsigned char **av; + unsigned char **av = NULL; unsigned char *p; el_STATUS s; int ac; @@ -1318,7 +1318,7 @@ last_argument(void) else s = ac ? insert_string(av[ac - 1]) : CSstay; - if (ac) + if (av) free(av); free(p); return s; -- 2.11.4.GIT