diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-11-03 00:33:42 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-11-03 00:33:42 +0100 |
| commit | 3e54b8257ed66c8f10fa904655f554990931ab88 (patch) | |
| tree | e3ecdb1b7aff8522f744bb7956453510c645346e /get_next_line_utils.c | |
| parent | 0a966722ec0236521d99706632a7fe56b7245379 (diff) | |
| download | get_next_line-3e54b8257ed66c8f10fa904655f554990931ab88.tar.gz get_next_line-3e54b8257ed66c8f10fa904655f554990931ab88.tar.bz2 get_next_line-3e54b8257ed66c8f10fa904655f554990931ab88.zip | |
Fixed rest and buf memory leaks
Diffstat (limited to 'get_next_line_utils.c')
| -rw-r--r-- | get_next_line_utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/get_next_line_utils.c b/get_next_line_utils.c index 92cb208..096fb84 100644 --- a/get_next_line_utils.c +++ b/get_next_line_utils.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/08 08:52:59 by cacharle #+# #+# */ -/* Updated: 2019/11/02 23:01:40 by cacharle ### ########.fr */ +/* Updated: 2019/11/03 00:26:34 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,6 +18,8 @@ char *ft_strappend(char *dest, char *src) void *copy; int dest_len; + if (dest == NULL) + return (ft_strdup(src)); dest_len = ft_strlen(dest); if ((copy = (char*)malloc(sizeof(char) * (dest_len + 1))) == NULL) return (NULL); |
