diff --git a/src/editline.c b/src/editline.c index 130d79f..a706368 100644 --- a/src/editline.c +++ b/src/editline.c @@ -1369,8 +1369,10 @@ static el_status_t c_complete(void) len = strlen(p); word = p; new = q = malloc(sizeof(char) * (2 * len + 1)); - if (!new) + if (!new) { + free(word); return CSstay; + } while (*p) { if ((*p < ' ' || strchr(SEPS, *p) != NULL) && (!unique || p[1] != 0)) {