diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-16 21:09:14 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-16 21:09:14 +0200 |
commit | c8ba75c31c949d3b5e5ba44e389550ea10096c5d (patch) | |
tree | 3fd61cd13f2ba9452c49cc9b48449c2458580454 /src/m_mshrc.c | |
parent | Todo update (diff) | |
download | 42-minishell-c8ba75c31c949d3b5e5ba44e389550ea10096c5d.tar.gz 42-minishell-c8ba75c31c949d3b5e5ba44e389550ea10096c5d.tar.bz2 42-minishell-c8ba75c31c949d3b5e5ba44e389550ea10096c5d.tar.xz 42-minishell-c8ba75c31c949d3b5e5ba44e389550ea10096c5d.tar.zst 42-minishell-c8ba75c31c949d3b5e5ba44e389550ea10096c5d.zip |
Leak fix
Diffstat (limited to 'src/m_mshrc.c')
-rw-r--r-- | src/m_mshrc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/m_mshrc.c b/src/m_mshrc.c index 7f6b8b9..5b1277e 100644 --- a/src/m_mshrc.c +++ b/src/m_mshrc.c @@ -22,8 +22,7 @@ #include "m_loop.h" #include "u_vars.h" -uint8_t - m_source_mshrc(t_msh *msh) +uint8_t m_source_mshrc(t_msh *msh) { char file[PATH_MAX]; char home[PATH_MAX]; @@ -34,7 +33,7 @@ uint8_t ft_sprintf(file, "%s/%s", home, FT_MINISHELLRC); if ((fd = open(file, O_RDONLY)) < 0) return (0); + msh->fd = fd; ret = m_loop(fd, msh); - close(fd); return (ret); } |