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';
|
*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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user