mirror of
https://github.com/troglobit/editline.git
synced 2025-05-06 12:31:45 +08:00
Fix memory leak
This commit is contained in:
parent
02ea37e4de
commit
8e13c7b5ae
@ -1392,12 +1392,13 @@ static int argify(char *line, char ***avp)
|
||||
}
|
||||
*c = '\0';
|
||||
p[ac] = NULL;
|
||||
|
||||
return ac;
|
||||
}
|
||||
|
||||
static el_status_t last_argument(void)
|
||||
{
|
||||
char **av;
|
||||
char **av = NULL;
|
||||
char *p;
|
||||
el_status_t s;
|
||||
int ac;
|
||||
@ -1414,7 +1415,7 @@ static el_status_t last_argument(void)
|
||||
else
|
||||
s = ac ? insert_string(av[ac - 1]) : CSstay;
|
||||
|
||||
if (ac)
|
||||
if (av)
|
||||
free(av);
|
||||
free(p);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user