LukasKava / Minishell

0 stars 0 forks source link

$>unset PWD $>env | grep PWD #47

Closed Gotr-byte closed 1 year ago

Gotr-byte commented 1 year ago

BiebianOS> unset PWD ____CHUNK LIST_____ full listC: indentifier: 21: (null) ARGUMENTS: unset PWD

BiebianOS> env | grep PWD ____CHUNK LIST_____ full listC: indentifier: 21: (null) ARGUMENTS: env

full listC: indentifier: 20: /usr/bin/grep ARGUMENTS: grep PWD

================================================================= ==9555==ERROR: LeakSanitizer: detected memory leaks

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

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

#1 0x564f4e74006f in ft_calloc (/home/piotr/code/mini/minishell+0x1b06f)
#2 0x564f4e7379c9 in save_name src/builtins/builtins_utils.c:121
#3 0x564f4e73b9f9 in delete_env_node src/builtins/unset.c:64
#4 0x564f4e73c0e3 in builtins_unset src/builtins/unset.c:130
#5 0x564f4e73f7a3 in unset_handle src/execute/builtin_handles.c:95
#6 0x564f4e73cb11 in built_in_handler src/execute/new_fork.c:107
#7 0x564f4e73ce2d in execute src/execute/new_fork.c:134
#8 0x564f4e729e47 in parsing_and_execution src/parsing/main.c:123
#9 0x564f4e72a0f6 in main src/parsing/main.c:155
#10 0x7f91dab71d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

SUMMARY: AddressSanitizer: 6 byte(s) leaked in 1 allocation(s). OLDPWD=/home/piotr/code BiebianOS> pwd

LukasKava commented 1 year ago

fixed the leak.