Fix memory leak

This commit is contained in:
Joachim Nilsson 2010-07-24 03:05:23 +02:00
parent 02ea37e4de
commit 8e13c7b5ae

View File

@ -1392,12 +1392,13 @@ static int argify(char *line, char ***avp)
} }
*c = '\0'; *c = '\0';
p[ac] = NULL; p[ac] = NULL;
return ac; return ac;
} }
static el_status_t last_argument(void) static el_status_t last_argument(void)
{ {
char **av; char **av = NULL;
char *p; char *p;
el_status_t s; el_status_t s;
int ac; int ac;
@ -1414,7 +1415,7 @@ static el_status_t last_argument(void)
else else
s = ac ? insert_string(av[ac - 1]) : CSstay; s = ac ? insert_string(av[ac - 1]) : CSstay;
if (ac) if (av)
free(av); free(av);
free(p); free(p);