retrieve_path() leak fixed

This commit is contained in:
lperrey
2021-12-22 19:34:21 +01:00
parent 9bffb99b30
commit 69adb1cf2f
5 changed files with 21 additions and 13 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/05 17:05:05 by lperrey #+# #+# */
/* Updated: 2021/12/18 13:41:15 by lperrey ### ########.fr */
/* Updated: 2021/12/22 19:23:50 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,7 +28,7 @@ int builtin_unset(int argc, char *argv[], t_all *c)
if (unset_env_var(argv[i]) == EXIT_FAILURE)
exit_value = EXIT_FAILURE;
if (ft_strncmp(argv[i], "PATH", 4 + 1) == 0)
c->path = retrieve_path();
retrieve_path(&c->path);
i++;
}
return (exit_value);