leak: resolve one memory leak

This commit is contained in:
Khaïs COLIN 2025-03-04 13:31:22 +01:00 committed by Khaïs COLIN
parent 5bf4bb8d6a
commit 69b247697c
2 changed files with 7 additions and 5 deletions

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/24 17:40:48 by khais #+# #+# */
/* Updated: 2025/03/04 13:43:39 by khais ### ########.fr */
/* Updated: 2025/03/04 13:54:03 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,6 +18,8 @@
#include "unistd.h"
#include <assert.h>
extern void __lsan_do_leak_check(void);
static t_cmdlist *parse_command_list(char *input)
{
ft_dprintf(STDERR_FILENO, "Now checking command list with input [%s]\n", input);
@ -173,10 +175,9 @@ static void test_parse_command_list_invalid_pipeline(void)
ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__);
t_cmdlist *cmd = parse_command_list("echo this | | cat -e || echo does not work");
assert(cmd == NULL);
cmdlist_destroy(cmd);
}
extern void __lsan_do_leak_check(void);
int main(void)
{
test_parse_command_list_invalid_pipeline();