Some more memory improvements

* Less leaks
* Less allocations

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
Steffen Jaeckel
2025-03-07 22:31:58 +01:00
parent 9fc0326428
commit 95c2199ca2
10 changed files with 63 additions and 21 deletions

View File

@@ -173,8 +173,6 @@ create_input_window(void)
char*
inp_readline(void)
{
free(inp_line);
inp_line = NULL;
p_rl_timeout.tv_sec = inp_timeout / 1000;
p_rl_timeout.tv_usec = inp_timeout % 1000 * 1000;
FD_ZERO(&fds);
@@ -216,7 +214,9 @@ inp_readline(void)
}
}
}
return strdup(inp_line);
char* ret = inp_line;
inp_line = NULL;
return ret;
} else {
return NULL;
}