diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-12-16 19:41:11 +0100 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-12-16 19:41:11 +0100 |
commit | 248372704dff81b91153d9e43a4b29a08551f99f (patch) | |
tree | c0cab1a9d3682e987a23bb369ec19e932fb8cb4b /src | |
parent | check for leaks.......again (diff) | |
download | 42-minishell-248372704dff81b91153d9e43a4b29a08551f99f.tar.gz 42-minishell-248372704dff81b91153d9e43a4b29a08551f99f.tar.bz2 42-minishell-248372704dff81b91153d9e43a4b29a08551f99f.tar.xz 42-minishell-248372704dff81b91153d9e43a4b29a08551f99f.tar.zst 42-minishell-248372704dff81b91153d9e43a4b29a08551f99f.zip |
ormnshitz
Diffstat (limited to 'src')
-rw-r--r-- | src/c_init.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/c_init.c b/src/c_init.c index 59cb5fa..4bfcf26 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -157,8 +157,9 @@ short msh->sig = 0; tcaps.plen = (unsigned int)m_plen(msh->ps[psx - 1]); *line = NULL; - if (!(*line = ft_calloc(sizeof(char), 1))) - return (-1); + if (*line == NULL) + if (!(*line = ft_calloc(sizeof(char), 1))) + return (-1); if (!(c_get_win_size(&tcaps.ws))) return (-1); while (!(ft_strchr(nread, '\n'))) |