tselmeg8070/minishell

export leak

Closed this issue · 0 comments

minishell>export test="s -a"
Token: export
Inner: export
Token: test="s -a"
Inner: test="s -a"
minishell>export test="s -a"
Token: export
Inner: export
Token: test="s -a"
Inner: test="s -a"
minishell>export test="s -a"
Token: export
Inner: export
Token: test="s -a"
Inner: test="s -a"
minishell>echo tselmeg
Token: echo
Inner: echo
Token: tselmeg
Inner: tselmeg
tselmeg
==715152== 
==715152== HEAP SUMMARY:
==715152==     in use at exit: 209,068 bytes in 282 blocks
==715152==   total heap usage: 1,726 allocs, 1,444 frees, 246,459 bytes allocated
==715152== 
==715152== 5 bytes in 1 blocks are definitely lost in loss record 1 of 71
==715152==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==715152==    by 0x407B6A: ft_strdup (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x407672: ft_env_lstnew (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406A2B: ft_envcreate (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406BBF: ft_export_env (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406CD8: ft_export (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x404AFB: ft_builtin_caller (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x4053DF: ft_call_single_builtin (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x405669: ft_call_execution (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401C4D: ft_command_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401D13: ft_lexa_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401DA8: ft_minishell_exit_result (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152== 
==715152== 25 bytes in 5 blocks are definitely lost in loss record 13 of 71
==715152==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==715152==    by 0x407B6A: ft_strdup (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406B66: ft_export_env (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406CD8: ft_export (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x404AFB: ft_builtin_caller (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x4053DF: ft_call_single_builtin (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x405669: ft_call_execution (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401C4D: ft_command_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401D13: ft_lexa_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401DA8: ft_minishell_exit_result (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x4020AE: ft_line_loop (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x40142D: main (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152== 
==715152== 30 bytes in 6 blocks are indirectly lost in loss record 14 of 71
==715152==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==715152==    by 0x407C34: ft_substr (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x407639: ft_env_lstnew (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406A2B: ft_envcreate (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406B03: ft_export_env (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406CD8: ft_export (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x404AFB: ft_builtin_caller (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x4053DF: ft_call_single_builtin (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x405669: ft_call_execution (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401C4D: ft_command_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401D13: ft_lexa_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401DA8: ft_minishell_exit_result (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152== 
==715152== 30 bytes in 6 blocks are indirectly lost in loss record 15 of 71
==715152==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==715152==    by 0x407B6A: ft_strdup (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x407672: ft_env_lstnew (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406A2B: ft_envcreate (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406B03: ft_export_env (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406CD8: ft_export (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x404AFB: ft_builtin_caller (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x4053DF: ft_call_single_builtin (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x405669: ft_call_execution (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401C4D: ft_command_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401D13: ft_lexa_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401DA8: ft_minishell_exit_result (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152== 
==715152== 204 (144 direct, 60 indirect) bytes in 6 blocks are definitely lost in loss record 28 of 71
==715152==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==715152==    by 0x4075BC: ft_env_lstnew (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406A2B: ft_envcreate (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406B03: ft_export_env (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x406CD8: ft_export (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x404AFB: ft_builtin_caller (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x4053DF: ft_call_single_builtin (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x405669: ft_call_execution (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401C4D: ft_command_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401D13: ft_lexa_parse (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x401DA8: ft_minishell_exit_result (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152==    by 0x4020AE: ft_line_loop (in /mnt/nfs/homes/tadiyamu/42/minishell/minishell)
==715152== 
==715152== LEAK SUMMARY:
==715152==    definitely lost: 174 bytes in 12 blocks
==715152==    indirectly lost: 60 bytes in 12 blocks
==715152==      possibly lost: 0 bytes in 0 blocks
==715152==    still reachable: 0 bytes in 0 blocks
==715152==         suppressed: 208,834 bytes in 258 blocks
==715152== 
==715152== For lists of detected and suppressed errors, rerun with: -s
==715152== ERROR SUMMARY: 24 errors from 6 contexts (suppressed: 0 from 0)