diff options
Diffstat (limited to 'valgrind_out.txt')
| -rw-r--r-- | valgrind_out.txt | 1040 |
1 files changed, 0 insertions, 1040 deletions
diff --git a/valgrind_out.txt b/valgrind_out.txt deleted file mode 100644 index c005c63..0000000 --- a/valgrind_out.txt +++ /dev/null @@ -1,1040 +0,0 @@ -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; -} |
