faboussard / 42_minishell

1 stars 0 forks source link

Leak si un pipe contient infile et oufile mais pas de commande #84

Closed melobern closed 5 months ago

melobern commented 5 months ago

Commande : < Makefile < info.txt cat > un > deux > trois | < info.txt < Makefile > make1 > make2

>>>  Minishell>$ < Makefile < info.txt cat > un > deux > trois | < info.txt < Makefile > make1 > make2

=================================================================
==74547==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x49a27d in malloc (/home/mbernard/Documents/42_minishell/minishell+0x49a27d)
    #1 0x4ea3d0 in ft_calloc (/home/mbernard/Documents/42_minishell/minishell+0x4ea3d0)
    #2 0x4d4485 in define_file_token /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:21:14
    #3 0x4d4ace in create_out_files_list /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:59:4
    #4 0x4d4b66 in create_process_list_node /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:71:2
    #5 0x4d507b in create_process_list /home/mbernard/Documents/42_minishell/srcs/parser/process_list.c:68:3
    #6 0x4d397d in parse_input /home/mbernard/Documents/42_minishell/srcs/parser/parser.c:62:2
    #7 0x4cb8e6 in minishell_interactive /home/mbernard/Documents/42_minishell/srcs/main.c:59:7
    #8 0x4cc098 in main /home/mbernard/Documents/42_minishell/srcs/main.c:164:3
    #9 0x7f420898fd8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x49a27d in malloc (/home/mbernard/Documents/42_minishell/minishell+0x49a27d)
    #1 0x4ea3d0 in ft_calloc (/home/mbernard/Documents/42_minishell/minishell+0x4ea3d0)
    #2 0x4d4485 in define_file_token /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:21:14
    #3 0x4d491e in create_in_files_list /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:44:4
    #4 0x4d4b55 in create_process_list_node /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:70:2
    #5 0x4d507b in create_process_list /home/mbernard/Documents/42_minishell/srcs/parser/process_list.c:68:3
    #6 0x4d397d in parse_input /home/mbernard/Documents/42_minishell/srcs/parser/parser.c:62:2
    #7 0x4cb8e6 in minishell_interactive /home/mbernard/Documents/42_minishell/srcs/main.c:59:7
    #8 0x4cc098 in main /home/mbernard/Documents/42_minishell/srcs/main.c:164:3
    #9 0x7f420898fd8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

Indirect leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x49a27d in malloc (/home/mbernard/Documents/42_minishell/minishell+0x49a27d)
    #1 0x4ea3d0 in ft_calloc (/home/mbernard/Documents/42_minishell/minishell+0x4ea3d0)
    #2 0x4d4485 in define_file_token /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:21:14
    #3 0x4d4ace in create_out_files_list /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:59:4
    #4 0x4d4b66 in create_process_list_node /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:71:2
    #5 0x4d507b in create_process_list /home/mbernard/Documents/42_minishell/srcs/parser/process_list.c:68:3
    #6 0x4d397d in parse_input /home/mbernard/Documents/42_minishell/srcs/parser/parser.c:62:2
    #7 0x4cb8e6 in minishell_interactive /home/mbernard/Documents/42_minishell/srcs/main.c:59:7
    #8 0x4cc098 in main /home/mbernard/Documents/42_minishell/srcs/main.c:164:3
    #9 0x7f420898fd8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

Indirect leak of 9 byte(s) in 1 object(s) allocated from:
    #0 0x49a27d in malloc (/home/mbernard/Documents/42_minishell/minishell+0x49a27d)
    #1 0x4ea9a9 in ft_strdup (/home/mbernard/Documents/42_minishell/minishell+0x4ea9a9)
    #2 0x4d44da in define_file_token /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:24:20
    #3 0x4d491e in create_in_files_list /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:44:4
    #4 0x4d4b55 in create_process_list_node /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:70:2
    #5 0x4d507b in create_process_list /home/mbernard/Documents/42_minishell/srcs/parser/process_list.c:68:3
    #6 0x4d397d in parse_input /home/mbernard/Documents/42_minishell/srcs/parser/parser.c:62:2
    #7 0x4cb8e6 in minishell_interactive /home/mbernard/Documents/42_minishell/srcs/main.c:59:7
    #8 0x4cc098 in main /home/mbernard/Documents/42_minishell/srcs/main.c:164:3
    #9 0x7f420898fd8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

Indirect leak of 8 byte(s) in 2 object(s) allocated from:
    #0 0x49a27d in malloc (/home/mbernard/Documents/42_minishell/minishell+0x49a27d)
    #1 0x4ea9a9 in ft_strdup (/home/mbernard/Documents/42_minishell/minishell+0x4ea9a9)
    #2 0x4d44da in define_file_token /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:24:20
    #3 0x4d4ace in create_out_files_list /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:59:4
    #4 0x4d4b66 in create_process_list_node /home/mbernard/Documents/42_minishell/srcs/parser/create_process_list.c:71:2
    #5 0x4d507b in create_process_list /home/mbernard/Documents/42_minishell/srcs/parser/process_list.c:68:3
    #6 0x4d397d in parse_input /home/mbernard/Documents/42_minishell/srcs/parser/parser.c:62:2
    #7 0x4cb8e6 in minishell_interactive /home/mbernard/Documents/42_minishell/srcs/main.c:59:7
    #8 0x4cc098 in main /home/mbernard/Documents/42_minishell/srcs/main.c:164:3
    #9 0x7f420898fd8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
melobern commented 5 months ago

Lock en attendant si on le revoit