+++ /dev/null
-root@aaf7f63c7efc:/dorker_workspace# valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./minishell
-==7626== Memcheck, a memory error detector
-==7626== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
-==7626== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
-==7626== Command: ./minishell
-==7626==
-Minishell $ a
-==7626== Invalid read of size 8
-==7626== at 0x1097D1: free_tokens (free_token.c:55)
-==7626== by 0x10A08A: parse (parser.c:40)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Address 0x4b01c38 is 24 bytes inside a block of size 32 free'd
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x109746: free_token (free_token.c:24)
-==7626== by 0x10A395: collect_args (parse_cmd.c:91)
-==7626== by 0x10A24F: parse_cmd (parse_cmd.c:27)
-==7626== by 0x10A12A: parse_statement (parser.c:62)
-==7626== by 0x10A07A: parse (parser.c:39)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Block was alloc'd at
-==7626== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7626== by 0x1095F6: new_token (new_token.c:19)
-==7626== by 0x109686: new_str_token (new_token.c:36)
-==7626== by 0x109C55: snap_string_token (tokenizer.c:79)
-==7626== by 0x10A014: tokenizer (tokenizer.c:130)
-==7626== by 0x109573: repl (repl.c:50)
-==7626== by 0x109372: main (main.c:28)
-==7626==
-==7626== Invalid read of size 8
-==7626== at 0x1097DD: free_tokens (free_token.c:56)
-==7626== by 0x10A08A: parse (parser.c:40)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Address 0x4b01c28 is 8 bytes inside a block of size 32 free'd
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x109746: free_token (free_token.c:24)
-==7626== by 0x10A395: collect_args (parse_cmd.c:91)
-==7626== by 0x10A24F: parse_cmd (parse_cmd.c:27)
-==7626== by 0x10A12A: parse_statement (parser.c:62)
-==7626== by 0x10A07A: parse (parser.c:39)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Block was alloc'd at
-==7626== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7626== by 0x1095F6: new_token (new_token.c:19)
-==7626== by 0x109686: new_str_token (new_token.c:36)
-==7626== by 0x109C55: snap_string_token (tokenizer.c:79)
-==7626== by 0x10A014: tokenizer (tokenizer.c:130)
-==7626== by 0x109573: repl (repl.c:50)
-==7626== by 0x109372: main (main.c:28)
-==7626==
-==7626== Invalid free() / delete / delete[] / realloc()
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x1097F4: free_tokens (free_token.c:57)
-==7626== by 0x10A08A: parse (parser.c:40)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Address 0x4b01c20 is 0 bytes inside a block of size 32 free'd
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x109746: free_token (free_token.c:24)
-==7626== by 0x10A395: collect_args (parse_cmd.c:91)
-==7626== by 0x10A24F: parse_cmd (parse_cmd.c:27)
-==7626== by 0x10A12A: parse_statement (parser.c:62)
-==7626== by 0x10A07A: parse (parser.c:39)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Block was alloc'd at
-==7626== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7626== by 0x1095F6: new_token (new_token.c:19)
-==7626== by 0x109686: new_str_token (new_token.c:36)
-==7626== by 0x109C55: snap_string_token (tokenizer.c:79)
-==7626== by 0x10A014: tokenizer (tokenizer.c:130)
-==7626== by 0x109573: repl (repl.c:50)
-==7626== by 0x109372: main (main.c:28)
-==7626==
-a: command not found
-==7627==
-==7627== HEAP SUMMARY:
-==7627== in use at exit: 199,597 bytes in 269 blocks
-==7627== total heap usage: 450 allocs, 182 frees, 224,561 bytes allocated
-==7627==
-==7627== 2 bytes in 1 blocks are still reachable in loss record 1 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10D412: ft_strdup (in /dorker_workspace/minishell)
-==7627== by 0x10C82F: set_return_code (builtins_part_three.c:44)
-==7627== by 0x109355: main (main.c:27)
-==7627==
-==7627== 2 bytes in 1 blocks are still reachable in loss record 2 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10CFE2: ft_itoa (in /dorker_workspace/minishell)
-==7627== by 0x10C85F: set_return_code (builtins_part_three.c:48)
-==7627== by 0x109355: main (main.c:27)
-==7627==
-==7627== 2 bytes in 1 blocks are still reachable in loss record 3 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x489124E: _rl_init_locale (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4891321: _rl_init_eightbit (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700F2: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 2 bytes in 1 blocks are still reachable in loss record 4 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EFB9: readline_internal_teardown (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48703DA: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 2 bytes in 1 blocks are still reachable in loss record 5 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x489258C: alloc_history_entry (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48927F9: add_history (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x109553: repl (repl.c:48)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 2 bytes in 1 blocks are still reachable in loss record 6 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10B868: append_slice (format_string.c:41)
-==7627== by 0x10BC33: format_string (format_string.c:124)
-==7627== by 0x10A375: collect_args (parse_cmd.c:88)
-==7627== by 0x10A24F: parse_cmd (parse_cmd.c:27)
-==7627== by 0x10A12A: parse_statement (parser.c:62)
-==7627== by 0x10A07A: parse (parser.c:39)
-==7627== by 0x109586: repl (repl.c:51)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 5 bytes in 1 blocks are still reachable in loss record 7 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x494C969: strdup (strdup.c:42)
-==7627== by 0x4AA4435: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 6 bytes in 1 blocks are still reachable in loss record 8 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48976A6: sh_get_home_dir (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x489832C: tilde_expand_word (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4898560: tilde_expand (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487E26B: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487E4FB: rl_read_init_file (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700F9: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 7 bytes in 1 blocks are definitely lost in loss record 9 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10D4F9: ft_strjoin (in /dorker_workspace/minishell)
-==7627== by 0x10AFDA: find_in_path (get_cmd_path.c:79)
-==7627== by 0x10ADFF: get_cmd_path (get_cmd_path.c:34)
-==7627== by 0x10B720: exec_cmd (execute_cmd.c:96)
-==7627== by 0x10B622: execute_cmd (execute_cmd.c:66)
-==7627== by 0x10AB22: eval_rec (interpreter.c:46)
-==7627== by 0x10AB67: eval (interpreter.c:57)
-==7627== by 0x1095A4: repl (repl.c:53)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 8 bytes in 1 blocks are still reachable in loss record 10 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899377: xrealloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4881C4E: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48827F5: rl_expand_prompt (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486ECFE: rl_set_prompt (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870385: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 12 bytes in 1 blocks are still reachable in loss record 11 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48927D7: add_history (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x109553: repl (repl.c:48)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 13 bytes in 1 blocks are still reachable in loss record 12 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486ECDA: rl_set_prompt (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870385: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 13 bytes in 1 blocks are still reachable in loss record 13 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4882183: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48827F5: rl_expand_prompt (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486ECFE: rl_set_prompt (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870385: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 13 bytes in 1 blocks are still reachable in loss record 14 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487E422: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700F9: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 16 bytes in 1 blocks are still reachable in loss record 15 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x48701E7: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 16 bytes in 1 blocks are still reachable in loss record 16 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10A2DC: collect_args (parse_cmd.c:78)
-==7627== by 0x10A24F: parse_cmd (parse_cmd.c:27)
-==7627== by 0x10A12A: parse_statement (parser.c:62)
-==7627== by 0x10A07A: parse (parser.c:39)
-==7627== by 0x109586: repl (repl.c:51)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 20 bytes in 1 blocks are still reachable in loss record 17 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487F143: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487DFD2: rl_parse_and_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487E39C: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700F9: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 24 bytes in 1 blocks are still reachable in loss record 18 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10AD28: env_new (env.c:69)
-==7627== by 0x10C837: set_return_code (builtins_part_three.c:44)
-==7627== by 0x109355: main (main.c:27)
-==7627==
-==7627== 24 bytes in 1 blocks are still reachable in loss record 19 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4892573: alloc_history_entry (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48927F9: add_history (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x109553: repl (repl.c:48)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 33 bytes in 1 blocks are still reachable in loss record 20 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4AABF1A: _nc_read_termtype (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACB1A: _nc_read_file_entry (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACE7C: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACFCB: _nc_read_entry2 (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4018: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA43D5: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627==
-==7627== 33 bytes in 1 blocks are still reachable in loss record 21 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4A9F2E8: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4404: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 40 bytes in 1 blocks are still reachable in loss record 22 of 67
-==7627== at 0x48455EF: calloc (vg_replace_malloc.c:1328)
-==7627== by 0x4AA15CB: _nc_first_db (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACFA6: _nc_read_entry2 (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4018: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA43D5: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 44 bytes in 1 blocks are still reachable in loss record 23 of 67
-==7627== at 0x48455EF: calloc (vg_replace_malloc.c:1328)
-==7627== by 0x4AAC020: _nc_read_termtype (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACB1A: _nc_read_file_entry (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACE7C: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACFCB: _nc_read_entry2 (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4018: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA43D5: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627==
-==7627== 44 bytes in 1 blocks are still reachable in loss record 24 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4A9F0BE: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4404: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 56 bytes in 1 blocks are still reachable in loss record 25 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x109814: new_node (new_node.c:19)
-==7627== by 0x1098B2: new_cmd_node (new_node.c:45)
-==7627== by 0x10A284: parse_cmd (parse_cmd.c:33)
-==7627== by 0x10A12A: parse_statement (parser.c:62)
-==7627== by 0x10A07A: parse (parser.c:39)
-==7627== by 0x109586: repl (repl.c:51)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 61 bytes in 6 blocks are indirectly lost in loss record 26 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10D193: get_next_token (in /dorker_workspace/minishell)
-==7627== by 0x10D27E: ft_split (in /dorker_workspace/minishell)
-==7627== by 0x10C32A: get_split_path (env_tools.c:20)
-==7627== by 0x10AF78: find_in_path (get_cmd_path.c:70)
-==7627== by 0x10ADFF: get_cmd_path (get_cmd_path.c:34)
-==7627== by 0x10B720: exec_cmd (execute_cmd.c:96)
-==7627== by 0x10B622: execute_cmd (execute_cmd.c:66)
-==7627== by 0x10AB22: eval_rec (interpreter.c:46)
-==7627== by 0x10AB67: eval (interpreter.c:57)
-==7627== by 0x1095A4: repl (repl.c:53)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 72 bytes in 1 blocks are still reachable in loss record 27 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4AA1530: _nc_first_db (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACFA6: _nc_read_entry2 (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4018: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA43D5: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 78 bytes in 1 blocks are still reachable in loss record 28 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4A9F1FD: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4404: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 106 bytes in 12 blocks are still reachable in loss record 29 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10D412: ft_strdup (in /dorker_workspace/minishell)
-==7627== by 0x10ABEC: getenvlst (env.c:30)
-==7627== by 0x109344: main (main.c:26)
-==7627==
-==7627== 117 (56 direct, 61 indirect) bytes in 1 blocks are definitely lost in loss record 30 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10D236: ft_split (in /dorker_workspace/minishell)
-==7627== by 0x10C32A: get_split_path (env_tools.c:20)
-==7627== by 0x10AF78: find_in_path (get_cmd_path.c:70)
-==7627== by 0x10ADFF: get_cmd_path (get_cmd_path.c:34)
-==7627== by 0x10B720: exec_cmd (execute_cmd.c:96)
-==7627== by 0x10B622: execute_cmd (execute_cmd.c:66)
-==7627== by 0x10AB22: eval_rec (interpreter.c:46)
-==7627== by 0x10AB67: eval (interpreter.c:57)
-==7627== by 0x1095A4: repl (repl.c:53)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 156 bytes in 1 blocks are still reachable in loss record 31 of 67
-==7627== at 0x48455EF: calloc (vg_replace_malloc.c:1328)
-==7627== by 0x4AAC0CE: _nc_read_termtype (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACB1A: _nc_read_file_entry (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACE7C: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACFCB: _nc_read_entry2 (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4018: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA43D5: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627==
-==7627== 253 bytes in 12 blocks are still reachable in loss record 32 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10D412: ft_strdup (in /dorker_workspace/minishell)
-==7627== by 0x10AC03: getenvlst (env.c:31)
-==7627== by 0x109344: main (main.c:26)
-==7627==
-==7627== 256 bytes in 1 blocks are still reachable in loss record 33 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870346: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 288 bytes in 12 blocks are still reachable in loss record 34 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x10ABC9: getenvlst (env.c:29)
-==7627== by 0x109344: main (main.c:26)
-==7627==
-==7627== 760 bytes in 1 blocks are still reachable in loss record 35 of 67
-==7627== at 0x48455EF: calloc (vg_replace_malloc.c:1328)
-==7627== by 0x4AA437F: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 1,024 bytes in 1 blocks are still reachable in loss record 36 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899377: xrealloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48813DB: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48814E2: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4887916: rl_redisplay (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EDFA: readline_internal_setup (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48703AE: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 1,024 bytes in 1 blocks are still reachable in loss record 37 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899377: xrealloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48813F3: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48814E2: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4887916: rl_redisplay (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EDFA: readline_internal_setup (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48703AE: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 1,024 bytes in 1 blocks are still reachable in loss record 38 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899377: xrealloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x488140B: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48814E2: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4887916: rl_redisplay (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EDFA: readline_internal_setup (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48703AE: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 1,024 bytes in 1 blocks are still reachable in loss record 39 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899377: xrealloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4881423: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48814E2: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4887916: rl_redisplay (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EDFA: readline_internal_setup (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48703AE: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 1,024 bytes in 1 blocks are still reachable in loss record 40 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4881535: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4887916: rl_redisplay (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EDFA: readline_internal_setup (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48703AE: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 1,024 bytes in 1 blocks are still reachable in loss record 41 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4881550: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4887916: rl_redisplay (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EDFA: readline_internal_setup (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48703AE: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 1,024 bytes in 1 blocks are still reachable in loss record 42 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4881568: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4887916: rl_redisplay (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EDFA: readline_internal_setup (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48703AE: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 1,024 bytes in 1 blocks are still reachable in loss record 43 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4881580: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4887916: rl_redisplay (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EDFA: readline_internal_setup (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48703AE: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 1,536 bytes in 1 blocks are still reachable in loss record 44 of 67
-==7627== at 0x484582F: realloc (vg_replace_malloc.c:1437)
-==7627== by 0x489935D: xrealloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874B84: rl_add_funmap_entry (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874BCE: rl_initialize_funmap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700ED: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 2,032 bytes in 1 blocks are still reachable in loss record 45 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x488E6C9: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 2,272 bytes in 142 blocks are still reachable in loss record 46 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874B2C: rl_add_funmap_entry (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874BCE: rl_initialize_funmap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700ED: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 3,312 bytes in 1 blocks are still reachable in loss record 47 of 67
-==7627== at 0x48455EF: calloc (vg_replace_malloc.c:1328)
-==7627== by 0x4AAC1A9: _nc_read_termtype (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACB1A: _nc_read_file_entry (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACE7C: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AACFCB: _nc_read_entry2 (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4018: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA43D5: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627==
-==7627== 3,312 bytes in 1 blocks are still reachable in loss record 48 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4A9F0DE: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4404: _nc_setupterm (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA4922: tgetent_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E45C: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 4,016 bytes in 1 blocks are still reachable in loss record 49 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4892869: add_history (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x109553: repl (repl.c:48)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 4,080 bytes in 1 blocks are still reachable in loss record 50 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x488E6A9: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 4,112 bytes in 1 blocks are still reachable in loss record 51 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EBD9: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870145: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 4,112 bytes in 1 blocks are still reachable in loss record 52 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EC7A: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870145: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 4,112 bytes in 1 blocks are still reachable in loss record 53 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EBD9: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870154: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 4,112 bytes in 1 blocks are still reachable in loss record 54 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EC7A: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870154: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 4,112 bytes in 1 blocks are still reachable in loss record 55 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EBD9: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870179: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 4,112 bytes in 1 blocks are still reachable in loss record 56 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EC7A: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870179: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 7,952 bytes in 1 blocks are still reachable in loss record 57 of 67
-==7627== at 0x48455EF: calloc (vg_replace_malloc.c:1328)
-==7627== by 0x4AA07A7: ??? (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA0F1A: _nc_find_type_entry (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x4AA52B4: tgetstr_sp (in /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4)
-==7627== by 0x488E49A: _rl_init_terminal_io (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700D0: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 8,224 bytes in 2 blocks are still reachable in loss record 58 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EC6B: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870145: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 8,224 bytes in 2 blocks are still reachable in loss record 59 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EB62: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870154: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 8,224 bytes in 2 blocks are still reachable in loss record 60 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EB62: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870179: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 8,224 bytes in 2 blocks are still reachable in loss record 61 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870193: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 12,336 bytes in 3 blocks are still reachable in loss record 62 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EC42: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870154: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 12,336 bytes in 3 blocks are still reachable in loss record 63 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EC6B: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870154: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 12,336 bytes in 3 blocks are still reachable in loss record 64 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EC42: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870179: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 12,336 bytes in 3 blocks are still reachable in loss record 65 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x486EC6B: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4870179: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 12,336 bytes in 3 blocks are still reachable in loss record 66 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487D4AD: rl_bind_keyseq_if_unbound_in_map (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48701A2: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== 41,120 bytes in 10 blocks are still reachable in loss record 67 of 67
-==7627== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7627== by 0x4899338: xmalloc (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x4874CBD: rl_make_bare_keymap (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487C3DD: rl_generic_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487E1BA: rl_parse_and_bind (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487E39C: ??? (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x48700F9: rl_initialize (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x487038A: readline (in /usr/lib/x86_64-linux-gnu/libreadline.so.8.2)
-==7627== by 0x1094FF: repl (repl.c:38)
-==7627== by 0x109372: main (main.c:28)
-==7627==
-==7627== LEAK SUMMARY:
-==7627== definitely lost: 63 bytes in 2 blocks
-==7627== indirectly lost: 61 bytes in 6 blocks
-==7627== possibly lost: 0 bytes in 0 blocks
-==7627== still reachable: 199,473 bytes in 261 blocks
-==7627== suppressed: 0 bytes in 0 blocks
-==7627==
-==7627== For lists of detected and suppressed errors, rerun with: -s
-==7627== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)
-==7626== Invalid read of size 8
-==7626== at 0x1097D1: free_tokens (free_token.c:55)
-==7626== by 0x1094C1: free_repl (repl.c:25)
-==7626== by 0x1095CB: repl (repl.c:54)
-==7626== by 0x109372: main (main.c:28)
-==7626== Address 0x4b01c38 is 24 bytes inside a block of size 32 free'd
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x109746: free_token (free_token.c:24)
-==7626== by 0x10A395: collect_args (parse_cmd.c:91)
-==7626== by 0x10A24F: parse_cmd (parse_cmd.c:27)
-==7626== by 0x10A12A: parse_statement (parser.c:62)
-==7626== by 0x10A07A: parse (parser.c:39)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Block was alloc'd at
-==7626== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7626== by 0x1095F6: new_token (new_token.c:19)
-==7626== by 0x109686: new_str_token (new_token.c:36)
-==7626== by 0x109C55: snap_string_token (tokenizer.c:79)
-==7626== by 0x10A014: tokenizer (tokenizer.c:130)
-==7626== by 0x109573: repl (repl.c:50)
-==7626== by 0x109372: main (main.c:28)
-==7626==
-==7626== Invalid read of size 8
-==7626== at 0x1097DD: free_tokens (free_token.c:56)
-==7626== by 0x1094C1: free_repl (repl.c:25)
-==7626== by 0x1095CB: repl (repl.c:54)
-==7626== by 0x109372: main (main.c:28)
-==7626== Address 0x4b01c28 is 8 bytes inside a block of size 32 free'd
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x109746: free_token (free_token.c:24)
-==7626== by 0x10A395: collect_args (parse_cmd.c:91)
-==7626== by 0x10A24F: parse_cmd (parse_cmd.c:27)
-==7626== by 0x10A12A: parse_statement (parser.c:62)
-==7626== by 0x10A07A: parse (parser.c:39)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Block was alloc'd at
-==7626== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7626== by 0x1095F6: new_token (new_token.c:19)
-==7626== by 0x109686: new_str_token (new_token.c:36)
-==7626== by 0x109C55: snap_string_token (tokenizer.c:79)
-==7626== by 0x10A014: tokenizer (tokenizer.c:130)
-==7626== by 0x109573: repl (repl.c:50)
-==7626== by 0x109372: main (main.c:28)
-==7626==
-==7626== Invalid free() / delete / delete[] / realloc()
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x1097E8: free_tokens (free_token.c:56)
-==7626== by 0x1094C1: free_repl (repl.c:25)
-==7626== by 0x1095CB: repl (repl.c:54)
-==7626== by 0x109372: main (main.c:28)
-==7626== Address 0x4b01bd0 is 0 bytes inside a block of size 2 free'd
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x1097E8: free_tokens (free_token.c:56)
-==7626== by 0x10A08A: parse (parser.c:40)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Block was alloc'd at
-==7626== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7626== by 0x109BCD: snap_string_token (tokenizer.c:68)
-==7626== by 0x10A014: tokenizer (tokenizer.c:130)
-==7626== by 0x109573: repl (repl.c:50)
-==7626== by 0x109372: main (main.c:28)
-==7626==
-==7626== Invalid free() / delete / delete[] / realloc()
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x1097F4: free_tokens (free_token.c:57)
-==7626== by 0x1094C1: free_repl (repl.c:25)
-==7626== by 0x1095CB: repl (repl.c:54)
-==7626== by 0x109372: main (main.c:28)
-==7626== Address 0x4b01c20 is 0 bytes inside a block of size 32 free'd
-==7626== at 0x484317B: free (vg_replace_malloc.c:872)
-==7626== by 0x109746: free_token (free_token.c:24)
-==7626== by 0x10A395: collect_args (parse_cmd.c:91)
-==7626== by 0x10A24F: parse_cmd (parse_cmd.c:27)
-==7626== by 0x10A12A: parse_statement (parser.c:62)
-==7626== by 0x10A07A: parse (parser.c:39)
-==7626== by 0x109586: repl (repl.c:51)
-==7626== by 0x109372: main (main.c:28)
-==7626== Block was alloc'd at
-==7626== at 0x48407B4: malloc (vg_replace_malloc.c:381)
-==7626== by 0x1095F6: new_token (new_token.c:19)
-==7626== by 0x109686: new_str_token (new_token.c:36)
-==7626== by 0x109C55: snap_string_token (tokenizer.c:79)
-==7626== by 0x10A014: tokenizer (tokenizer.c:130)
-==7626== by 0x109573: repl (repl.c:50)
-==7626== by 0x109372: main (main.c:28)
-==7626==
-
-atic t_assign **collect_assigns(t_token **tokens);
-static char **collect_args(t_token **tokens);
-static t_assign *to_assign(char *str);
-static void set_redir(t_redirection *redir, int type,
- char *specifier);
-
-t_node *parse_cmd(t_token *tokens)
-{
- char **args;
- t_assign **assigns;
- t_redirection *redirs;
-
- redirs = collect_redirs(&tokens);
- assigns = collect_assigns(&tokens);
- args = collect_args(&tokens);
- return (new_cmd_node(args, assigns, redirs));
-}
-
-static t_redirection *collect_redirs(t_token **tokens)
-{
- t_redirection *result;
- t_token *cur;
- int idx;
-
- cur = *tokens;
- result = malloc(sizeof(t_redirection) * 2);
- if (result == NULL)
- {
- // free all tokens
- return (NULL);
- }
- set_redir(&result[0], 0, NULL);
- set_redir(&result[1], 0, NULL);
- while (cur != NULL && cur->next != NULL)
- {
- if (cur->type == REDIR_TOKEN && cur->next->type == STRING_TOKEN)
- {
- if (cur->content.redir_type & (INPUT_FILE | INPUT_LIMITER))
- idx = 0;
- else if (cur->content.redir_type & (OUTPUT_APPEND | OUTPUT_OVERRIDE))
- idx = 1;
- set_redir(&result[idx], cur->content.redir_type,
- cur->next->content.string);
- cur = cur->next;
- free_token_and_connect(cur->previous);
- if (cur->next != NULL)
- {
- cur = cur->next;
- free_token_and_connect(cur->previous);
- }
- else
- {
- free_token(cur);
- }
- }
- else if (cur->type == REDIR_TOKEN)
- {
- // err Parsing error
- free(result);
- return (NULL);
- }
- else
- {
- cur = cur->next;
- }
- }
- return (result);
-}
-
-static t_assign **collect_assigns(t_token **tokens)
-{
- t_token *cur;
- t_assign **result;
- int i;
-
- cur = *tokens;
- i = 0;
- while (cur != NULL && cur->type == STRING_TOKEN
- && cur->content.string[0] != '"' && cur->content.string[0] != '\''
- && ft_strchr(cur->content.string, '=') != NULL)
- {
- i++;
- cur = cur->next;
- }
- result = malloc(sizeof(t_assign *) * (i + 1));
- if (!result)
- {
- // free all tokens
- return (NULL);
- }
- cur = *tokens;
- i = 0;
- while (cur != NULL && cur->type == STRING_TOKEN
- && cur->content.string[0] != '"' && cur->content.string[0] != '\''
- && ft_strchr(cur->content.string, '=') != NULL)
- {
- result[i] = to_assign(cur->content.string);
- i++;
- cur = cur->next;
- free_token(cur->previous);
- }
- *tokens = cur;
- result[i] = NULL;
- return (result);
-}
-
-static t_assign *to_assign(char *str)
-{
- t_assign *result;
- char *split_pos;
-
- split_pos = ft_strchr(str, '=');
- *split_pos = '\0';
- result = malloc(sizeof(t_assign));
- if (result == NULL)
- {
- return (NULL);
- }
- result->var = str;
- result->value = split_pos + 1;
- return (result);
-}
-
-static char **collect_args(t_token **tokens)
-{
- t_token *cur;
- char **result;
- int i;
-
- cur = *tokens;
- i = 0;
- while (cur != NULL)
- {
- i++;
- cur = cur->next;
- }
- result = malloc(sizeof(char *) * (i + 1));
- if (!result)
- {
- // free all tokens;
- return (NULL);
- }
- cur = *tokens;
- i = 0;
- while (cur != NULL)
- {
- result[i] = cur->content.string;
- // free token
- i++;
- cur = cur->next;
- }
- result[i] = NULL;
- return (result);
-}
-
-static void set_redir(t_redirection *redir, int type, char *specifier)
-{
- redir->type = type;
- redir->specifier = specifier;
-}
+++ /dev/null
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* x.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2025/01/23 12:37:33 by chuhlig #+# #+# */
-/* Updated: 2025/01/23 17:37:13 by chuhlig ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-Code Review
-init.c
-This file initializes the terminal settings and signal handling. It looks correct, but consider checking if tcgetattr and tcsetattr return errors and handle them appropriately.
-
-C
-
-static void init_terminal(void) {
- struct termios term;
-
- if (tcgetattr(0, &term) == -1) {
- perror("tcgetattr failed");
- exit(EXIT_FAILURE);
- }
- term.c_lflag &= ~ECHOCTL;
- if (tcsetattr(0, TCSANOW, &term) == -1) {
- perror("tcsetattr failed");
- exit(EXIT_FAILURE);
- }
-}
-env.c
-In the getenvlst function, modifying the environment variable string directly can lead to undefined behavior. Instead, consider using strdup to make a copy of the string.
-
-C
-
-void getenvlst(t_env **env, char **en) {
- char *tmp;
- int i;
- t_env *current;
-
- i = 0;
- while (en[i] != NULL) {
- tmp = ft_strchr(en[i], '=');
- if (!tmp) continue;
- *tmp = '\0';
- current = malloc(sizeof(t_env));
- if (!current) exit(EXIT_FAILURE); // Handle malloc failure
- current->name = ft_strdup(en[i]);
- current->value = ft_strdup(tmp + 1);
- current->next = *env;
- *env = current;
- i++;
- }
-}
-repl.c
-The repl function looks good, but consider checking the readline return value for NULL and handling memory allocation errors.
-
-error.c
-The command_not_found_error function should ensure correct file descriptors:
-
-C
-
-void command_not_found_error(char *cmd) {
- ft_printf("%s:", cmd);
- ft_putstr_fd(" command not found", 2); // file descriptor 2 for stderr
- ft_printf("\n");
-}
-new_node.c
-The new_cmd_node function calls free(redirs) but then returns NULL without freeing the allocated node.
-
-C
-
-t_node *new_cmd_node(char **args, t_redirection redirs[2], t_list *create_files) {
- t_node *node = new_node(CMD_NODE);
- if (!node) return NULL;
- node->content.cmd.args = args;
- if (redirs) {
- node->content.cmd.redirs[0] = redirs[0];
- node->content.cmd.redirs[1] = redirs[1];
- node->content.cmd.create_files = create_files;
- free(redirs);
- redirs = NULL;
- return node;
- }
- free(node); // Free the allocated node
- return NULL;
-}
-free_node.c
-In free_cmd_node, ensure you free both redirections correctly.
-
-C
-
-static void free_cmd_node(t_node *node) {
- int i = 0;
- while (node->content.cmd.args && node->content.cmd.args[i]) {
- free(node->content.cmd.args[i]);
- i++;
- }
- free(node->content.cmd.args);
- if (node->content.cmd.redirs[0].type && node->content.cmd.redirs[0].specifier)
- free(node->content.cmd.redirs[0].specifier);
- if (node->content.cmd.redirs[1].type && node->content.cmd.redirs[1].specifier)
- free(node->content.cmd.redirs[1].specifier);
-}
-Summary
-The provided code generally looks well-structured, but there are some areas where error checking and memory management could be improved. Implementing these suggestions will help make the code more robust and easier to maintain. If you have any specific concerns or files you would like to focus on, please let me know!
-
-
-anything else?
-The initial analysis covered some key areas and potential improvements in the provided Makefile and source files. Here are a few more specific suggestions for certain files to ensure robustness and maintainability:
-
-Additional Suggestions
-env.c (Handling Environment Variables):
-Error Handling: Add error handling for ft_strdup and malloc to ensure memory allocation was successful.
-Environment String Handling: Avoid modifying the original environment strings directly.
-C
-
-void getenvlst(t_env **env, char **en) {
- char *tmp;
- int i;
- t_env *current;
-
- i = 0;
- while (en[i] != NULL) {
- tmp = ft_strchr(en[i], '=');
- if (!tmp) continue;
- *tmp = '\0';
- current = malloc(sizeof(t_env));
- if (!current || !(current->name = ft_strdup(en[i])) || !(current->value = ft_strdup(tmp + 1))) {
- perror("malloc or strdup failed");
- exit(EXIT_FAILURE);
- }
- current->next = *env;
- *env = current;
- *tmp = '='; // Restore the original string
- i++;
- }
-}
-repl.c (Read-Evaluate-Print Loop):
-Memory Management: Ensure all allocated memory is freed.
-Error Handling: Handle potential errors from functions like readline.
-C
-
-void repl(const char *prompt, t_env **env, int *promptflag) {
- char *input;
- t_token *token_list;
- t_list *lines;
-
- (*promptflag)++;
- while (1) {
- input = readline(prompt);
- if (input == NULL) {
- if (*promptflag > 1)
- (*promptflag)--;
- printf("exit\n");
- break;
- }
- if (input[0] == '\0') {
- free(input);
- continue;
- }
- add_history(input);
- token_list = NULL;
- tokenizer(input, &token_list, '\0');
- lines = parse(token_list, env);
- if (lines)
- set_return_code(eval(lines->content, env), env);
- free(input);
- free_tokens(token_list);
- ft_lstclear(&lines, (void (*)(void *))free_node);
- }
-}
-1 vulnerability detected
-get_cmd_path.c (Command Path Resolution):
-Error Handling: Ensure errors are correctly handled and resources are freed.
-C
-
-static char *get_absolute_cmd_path(char *cmd, t_env *env, int *return_code) {
- char *cur_dir;
- char *result;
-
- cur_dir = ft_strjoin(env_get(env, "PWD"), "/");
- if (!cur_dir) {
- return error(ENOMEM, cmd, 127, return_code);
- }
- result = ft_strjoin(cur_dir, cmd);
- free(cur_dir);
- if (!result) {
- return error(ENOENT, cmd, 127, return_code);
- }
- if (access(result, F_OK) == -1) {
- free(result);
- return error(ENOENT, cmd, 127, return_code);
- }
- if (access(result, X_OK) == -1) {
- free(result);
- return error(EACCES, cmd, 126, return_code);
- }
- if (is_directory(result)) {
- free(result);
- return error(EISDIR, cmd, 126, return_code);
- }
- return result;
-}
-General Best Practices:
-Consistent Error Handling: Ensure all functions consistently handle errors and free resources appropriately.
-Code Comments: Add comments to explain complex logic and improve code readability.
-Memory Management: Regularly check for potential memory leaks and ensure all allocated memory is freed.
-If you have any specific files or sections you want to dive deeper into, feel free to let me know!
-
-
-ok ill look over it: now after your analyze it seem tokens are not freed properly what i mean with that we are missing it seems on more free but im not sure where to place it especial when the input is invalid and cant be used properly
-It looks like you may need to ensure that tokens are properly freed, especially in cases where the input is invalid. Let's take a look at the relevant parts of the code that handle tokens and ensure that memory is managed correctly.
-
-Token Freeing Logic
-To help ensure that tokens are freed properly, let's review the primary functions that deal with token management and identify where additional freeing might be needed.
-
-Tokenizer Function
-The tokenizer function creates tokens. If the input is invalid, we should ensure we free any partially created tokens.
-
-C
-
-void tokenizer(char *s, t_token **token_list, char quote_check) {
- int pos = 0;
- int i = -1;
- int f = 0;
- while (s[++i]) {
- if (!f && ft_strchr("|<>\n", s[i]))
- handle_special_chars(s, &i, &pos, token_list);
- else if (f && s[i] == quote_check)
- f = 0;
- else if (!f && ft_strchr("\'\"", s[i])) {
- f = 1;
- quote_check = s[i];
- }
- if ((!f && (ft_isspace(s[i + 1]))) || i == ft_strlen(s) - 1) {
- snap_string_token(s, pos, i, token_list);
- pos = i + 1;
- }
- }
- *token_list = reverse_token_list(*token_list);
-}
-Free Tokens Function
-The free_tokens function should be used to free the entire token list:
-
-C
-
-void free_tokens(t_token *tokens) {
- while (tokens != NULL) {
- t_token *next = tokens->next;
- if (tokens->type == STRING_TOKEN)
- free(tokens->content.string);
- free(tokens);
- tokens = next;
- }
-}
-Parsing Logic
-In the parsing logic, ensure that tokens are freed if an error occurs:
-
-C
-
-t_list *parse(t_token *tokens, t_env **env) {
- t_node *result;
-
- if (tokens->type == PIPE_TOKEN) {
- free_tokens(tokens); // Free tokens if the first token is invalid
- return NULL;
- } else {
- result = parse_statement(tokens, env);
- }
- if (result == NULL) {
- printf("Parsing error.\n");
- free_tokens(tokens); // Free tokens if parsing fails
- }
- return ft_lstnew(result);
-}
-Example Fix
-Here is a more comprehensive example of how you can ensure tokens are freed correctly in the parse function and the collect_redirs function:
-
-C
-
-t_list *parse(t_token *tokens, t_env **env) {
- t_node *result;
-
- if (tokens == NULL || tokens->type == PIPE_TOKEN) {
- if (tokens) free_tokens(tokens); // Free tokens if the first token is invalid or NULL
- return NULL;
- }
- result = parse_statement(tokens, env);
- if (result == NULL) {
- printf("Parsing error.\n");
- free_tokens(tokens); // Free tokens if parsing fails
- }
- return ft_lstnew(result);
-}
-
-t_redirection *collect_redirs(t_token **tokens, t_env *env, t_list **create_files) {
- t_redirection *result;
- t_token *cur;
- t_minidata data;
-
- cur = *tokens;
- result = malloc(sizeof(t_redirection) * 2);
- if (result == NULL)
- return free_tokens(*tokens), NULL;
- set_redir(&result[0], 0, NULL, env);
- set_redir(&result[1], 0, NULL, env);
- data.create_files = create_files;
- data.env = env;
- while (cur != NULL) {
- if (cur->type == REDIR_TOKEN && cur->next->type == STRING_TOKEN)
- collect_and_check_redir(result, &cur, &data, tokens);
- else if (cur->type == REDIR_TOKEN)
- return free(result), free_tokens(*tokens), NULL;
- else
- cur = cur->next;
- }
- if (cur && cur->type == REDIR_TOKEN)
- return free(result), free_tokens(*tokens), NULL;
- return result;
-}
-Summary
-By ensuring that tokens are always freed when an error occurs or when they are no longer needed, you can avoid memory leaks and improve the robustness of your shell. If you have specific cases where you suspect tokens are not being freed correctly, please share those, and I can provide more targeted advice!
-
-
-tokens are never NULL except when i press enter but this is handle in repl and to your free token the problem is with our aproach is that parts of the token will be updated while running like in parser.c
-Thank you for the clarification. It seems like the tokens are being updated during parsing, which complicates the token freeing process. Let's ensure that we handle token freeing correctly in all cases, especially when errors occur during parsing.
-
-Reviewing the Token Management
-Since tokens are updated during parsing, we need to be careful to free tokens correctly without disrupting the parsing logic. We'll focus on ensuring that tokens are freed appropriately in various scenarios, including error cases.
-
-Parsing Logic and Freeing Tokens
-Parser Function: Ensure that tokens are freed if parsing fails.
-Free Tokens Helper Function: Improve the free_tokens function to handle partial frees.
-Example Fixes
-Free Tokens Function
-First, let's have a robust free_tokens function that can handle the complete or partial token lists:'
-
-C
-
-void free_tokens(t_token *tokens) {
- t_token *next;
- while (tokens != NULL) {
- next = tokens->next;
- if (tokens->type == STRING_TOKEN && tokens->content.string != NULL) {
- free(tokens->content.string);
- }
- free(tokens);
- tokens = next;
- }
-}
-Parsing Functions
-Next, ensure that the parsing logic properly frees tokens if an error occurs:
-
-parse Function:
-C
-
-t_list *parse(t_token *tokens, t_env **env) {
- t_node *result;
-
- if (tokens == NULL || tokens->type == PIPE_TOKEN) {
- if (tokens) free_tokens(tokens); // Free tokens if the first token is invalid or NULL
- return NULL;
- }
- result = parse_statement(tokens, env);
- if (result == NULL) {
- printf("Parsing error.\n");
- free_tokens(tokens); // Free tokens if parsing fails
- }
- return ft_lstnew(result);
-}
-parse_statement Function:
-C
-
-static t_node *parse_statement(t_token *tokens, t_env **env) {
- t_token *left_side_tokens;
-
- left_side_tokens = split_at_first(&tokens, PIPE_TOKEN);
- if (left_side_tokens == NULL) {
- free_tokens(tokens); // Free remaining tokens if split fails
- return NULL;
- }
- if (tokens != NULL) {
- t_node *left_node = parse_cmd(left_side_tokens, env);
- t_node *right_node = parse_statement(tokens, env);
- if (left_node == NULL || right_node == NULL) {
- free_tokens(left_side_tokens);
- free_tokens(tokens);
- return NULL;
- }
- return new_pipe_node(left_node, right_node);
- }
- return parse_cmd(left_side_tokens, env);
-}
-Handling Token Updates
-When tokens are updated, ensure that the old parts are freed correctly before being replaced. For example:
-
-C
-
-void update_token(t_token *token, int new_type, char *new_content) {
- if (token->type == STRING_TOKEN && token->content.string != NULL) {
- free(token->content.string);
- }
- token->type = new_type;
- token->content.string = new_content;
-}
-Summary
-By ensuring that tokens are properly freed in all scenarios, including when parsing errors occur and when tokens are updated, you can avoid memory leaks and ensure robust memory management. If you have any specific cases or additional concerns, please let me know!
-
-
-i never update tokens static char **collect_args(t_token **tokens, t_env **env) { t_token *cur; char **result; int i; t_token *next; cur = *tokens; i = 0; while (cur != NULL && ++i) cur = cur->next; result = malloc(sizeof(char *) * (i + 1)); if (result == NULL) return (free_tokens(*tokens), NULL); cur = *tokens; i = 0; while (cur != NULL && cur->type == STRING_TOKEN) { next = cur->next; if (cur->previous) free_token(cur->previous); result[i] = format_string(cur->content.string, *env, ft_atoi("0")); i++; if (cur->next == NULL) free_token(cur); cur = next; } result[i] = NULL; return (result); } any suggestions for this? static char **collect_args(t_token **tokens, t_env **env) { t_token *cur; char **result; int i; t_token *next; cur = *tokens; i = 0; while (cur != NULL && ++i) cur = cur->next; result = malloc(sizeof(char *) * (i + 1)); if (result == NULL) return (free_tokens(*tokens), NULL); cur = *tokens; i = 0; while (cur != NULL && cur->type == STRING_TOKEN) { next = cur->next; if (cur->previous) free_token(cur->previous); result[i] = format_string(cur->content.string, *env, ft_atoi("0")); i++; if (cur->next == NULL) free_token(cur); cur = next; } result[i] = NULL; return (result); } just take as example input : a and check the hole code for yourself
-Let's take a closer look at the collect_args function to ensure that tokens are freed properly and memory is managed correctly. The goal is to collect arguments from tokens, format them, and ensure that all tokens are freed without causing memory leaks or dangling pointers.
-
-Review of collect_args
-The function collect_args traverses the token list, collects string tokens, and formats them into an array of arguments. It also attempts to free tokens as it processes them.
-
-Here’s the function with comments and suggestions for improvement:'
-
-C
-
-static char **collect_args(t_token **tokens, t_env **env) {
- t_token *cur;
- char **result;
- int i;
- t_token *next;
-
- // Count the number of tokens
- cur = *tokens;
- i = 0;
- while (cur != NULL && ++i)
- cur = cur->next;
-
- // Allocate memory for the result array
- result = malloc(sizeof(char *) * (i + 1));
- if (result == NULL) {
- free_tokens(*tokens); // Free tokens if memory allocation fails
- return NULL;
- }
-
- // Collect and format string tokens
- cur = *tokens;
- i = 0;
- while (cur != NULL && cur->type == STRING_TOKEN) {
- next = cur->next;
- if (cur->previous)
- free_token(cur->previous); // Free the previous token
-
- result[i] = format_string(cur->content.string, *env, 0);
- if (result[i] == NULL) { // Check if format_string failed
- free_tokens(next); // Free remaining tokens
- while (i > 0) {
- free(result[--i]);
- }
- free(result);
- return NULL;
- }
-
- i++;
- if (cur->next == NULL)
- free_token(cur); // Free the current token if it's the last one
- cur = next;
- }
- result[i] = NULL;
- return result;
-}
-Improvements and Error Handling
-Error Handling: Improved error handling by checking if format_string failed and freeing the remaining tokens and allocated memory.
-Memory Allocation Check: Ensured that memory allocation failures for result and format_string are handled.
-Freeing Tokens: Ensured that tokens are properly freed, including the current token if it's the last one.
-Example Input: "a"
-For the input "a", the function should create a single argument "a" and ensure that all tokens are freed.
-
-Updated Function
-Here’s the updated function with the improvements:
-
-C'
-
-static char **collect_args(t_token **tokens, t_env **env) {
- t_token *cur;
- char **result;
- int i;
- t_token *next;
-
- // Count the number of tokens
- cur = *tokens;
- i = 0;
- while (cur != NULL && ++i)
- cur = cur->next;
-
- // Allocate memory for the result array
- result = malloc(sizeof(char *) * (i + 1));
- if (result == NULL) {
- free_tokens(*tokens); // Free tokens if memory allocation fails
- return NULL;
- }
-
- // Collect and format string tokens
- cur = *tokens;
- i = 0;
- while (cur != NULL && cur->type == STRING_TOKEN) {
- next = cur->next;
- if (cur->previous)
- free_token(cur->previous); // Free the previous token
-
- result[i] = format_string(cur->content.string, *env, 0);
- if (result[i] == NULL) { // Check if format_string failed
- free_tokens(next); // Free remaining tokens
- while (i > 0) {
- free(result[--i]);
- }
- free(result);
- return NULL;
- }
-
- i++;
- if (cur->next == NULL)
- free_token(cur); // Free the current token if it's the last one
- cur = next;
- }
- result[i] = NULL;
- return result;
-}
-
-
-tendenziel sollte in collect arg free token until
-
-parse ist das erste was nach token passiert und da wird token zu node umgewandelt
\ No newline at end of file