When we exit directly in the heredoc by entering the delimiter, there are several leaks:
๐ฆ๐ ~ Minishell : cat << lol
> lol
==37046== Invalid read of size 1
==37046== at 0x408109: ft_strjoin (in /mnt/nfs/homes/msanjuan/Documents/Projets_Github/42_Minishell/minishell)
==37046== by 0x403EF1: get_line_in_submode (03_parse_heredoc.c:39)
==37046== by 0x403DF0: stock_buffer (03_parse_heredoc.c:54)
==37046== by 0x403CC8: parse_heredoc (03_parse_heredoc.c:87)
==37046== by 0x403120: create_cmds (00_create_cmds.c:33)
==37046== by 0x401438: main (main.c:45)
==37046== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==37046==
==37046==
==37046== Process terminating with default action of signal 11 (SIGSEGV)
==37046== Access not within mapped region at address 0x0
==37046== at 0x408109: ft_strjoin (in /mnt/nfs/homes/msanjuan/Documents/Projets_Github/42_Minishell/minishell)
==37046== by 0x403EF1: get_line_in_submode (03_parse_heredoc.c:39)
==37046== by 0x403DF0: stock_buffer (03_parse_heredoc.c:54)
==37046== by 0x403CC8: parse_heredoc (03_parse_heredoc.c:87)
==37046== by 0x403120: create_cmds (00_create_cmds.c:33)
==37046== by 0x401438: main (main.c:45)
==37046== If you believe this happened as a result of a stack
==37046== overflow in your program's main thread (unlikely but
==37046== possible), you can try to increase the size of the
==37046== main thread stack using the --main-stacksize= flag.
==37046== The main thread stack size used in this run was 8388608.
==37046==
==37046== FILE DESCRIPTORS: 4 open at exit.
==37046== Open file descriptor 4:
==37046== at 0x49C295B: pipe (syscall-template.S:78)
==37046== by 0x403C07: parse_heredoc (03_parse_heredoc.c:68)
==37046== by 0x403120: create_cmds (00_create_cmds.c:33)
==37046== by 0x401438: main (main.c:45)
==37046==
==37046== Open file descriptor 2: /dev/pts/2
==37046== <inherited from parent>
==37046==
==37046== Open file descriptor 1: /dev/pts/2
==37046== <inherited from parent>
==37046==
==37046== Open file descriptor 0: /dev/pts/2
==37046== <inherited from parent>
==37046==
==37046==
==37046== HEAP SUMMARY:
==37046== in use at exit: 251,437 bytes in 1,310 blocks
==37046== total heap usage: 1,568 allocs, 258 frees, 273,090 bytes allocated