LukasKava / Minishell

0 stars 0 forks source link

leak after $>unset PATH $>ls #46

Closed Gotr-byte closed 1 year ago

Gotr-byte commented 1 year ago

BiebianOS> ls ERRROR in find path path is not excistent! ERRROR in parsing.c PATH is not excistent! ____CHUNK LIST_____ full listC: indentifier: 20: (null) ARGUMENTS: ls

: Bad address

================================================================= ==6875==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 96 byte(s) in 1 object(s) allocated from:

0 0x7f6faad85867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x555d1ea625b1 in ft_split (/home/piotr/code/mini/minishell+0x1b5b1)
#2 0x555d1ea5450a in find_command_path src/parsing/parsing.c:44
#3 0x555d1ea555a1 in get_the_commands src/parsing/parsing.c:204
#4 0x555d1ea4bd96 in parsing_and_execution src/parsing/main.c:119
#5 0x555d1ea4c0f6 in main src/parsing/main.c:155
#6 0x7f6faaa7ed8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Direct leak of 96 byte(s) in 1 object(s) allocated from:

0 0x7f6faad85867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x555d1ea625b1 in ft_split (/home/piotr/code/mini/minishell+0x1b5b1)
#2 0x555d1ea4fd1c in check_command_excists src/parsing/register_tokens.c:313
#3 0x555d1ea504e9 in register_tokens src/parsing/register_tokens.c:378
#4 0x555d1ea4bd27 in parsing_and_execution src/parsing/main.c:117
#5 0x555d1ea4c0f6 in main src/parsing/main.c:155
#6 0x7f6faaa7ed8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Direct leak of 36 byte(s) in 6 object(s) allocated from:

0 0x7f6faad85867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x555d1ea6206f in ft_calloc (/home/piotr/code/mini/minishell+0x1b06f)
#2 0x555d1ea599c9 in save_name src/builtins/builtins_utils.c:121
#3 0x555d1ea5d9f9 in delete_env_node src/builtins/unset.c:64
#4 0x555d1ea5e0e3 in builtins_unset src/builtins/unset.c:130
#5 0x555d1ea617a3 in unset_handle src/execute/builtin_handles.c:95
#6 0x555d1ea5eb11 in built_in_handler src/execute/new_fork.c:107
#7 0x555d1ea5ee2d in execute src/execute/new_fork.c:134
#8 0x555d1ea4be47 in parsing_and_execution src/parsing/main.c:123
#9 0x555d1ea4c0f6 in main src/parsing/main.c:155
#10 0x7f6faaa7ed8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Indirect leak of 157 byte(s) in 11 object(s) allocated from:

0 0x7f6faad85867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145

#1 0x555d1ea626d0 in ft_strjoin (/home/piotr/code/mini/minishell+0x1b6d0)
#2 0x555d1ea4feb0 in check_command_excists src/parsing/register_tokens.c:318
#3 0x555d1ea504e9 in register_tokens src/parsing/register_tokens.c:378
#4 0x555d1ea4bd27 in parsing_and_execution src/parsing/main.c:117
#5 0x555d1ea4c0f6 in main src/parsing/main.c:155
#6 0x7f6faaa7ed8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

SUMMARY: AddressSanitizer: 385 byte(s) leaked in 19 allocation(s).

LukasKava commented 1 year ago

fixed the leak