42-Lyon-Projects / minishell-revamp

0 stars 1 forks source link

[BUG] Leaks - ft_strdup & ft_substr & malloc #13

Closed LuyNagda closed 10 months ago

LuyNagda commented 10 months ago

already_exist

Github Branch Name

12-merge-new-parsing-with-pipex

Discord username

luynagda

What Happened ?

Leaks due to passing a malloc'd without ever freeing it.

Steps to reproduce the bug / problem.

make with valgrind, run minishell run commands: cat|cat|ls exit

What was supposed to happen ?

No leaks.

Screenshot or vidéo

image

As you can see in the below screenshot, using ft_substr directly in a function is wrong (line 100 and 107):

image

Likewise, same issue here:

image

More informations

No response

vSKAH commented 10 months ago

Okay, i will try this and fix it in the branch associated on issue

vSKAH commented 10 months ago

I have pushed patch in 13-bug-leaks-ft_strdup-ft_substr-malloc.

This Patch contains :

:bug: Sended line are now correctly free :bug: Token value are now correctly free

vSKAH commented 10 months ago

There's still a leak on the commands, I'll look into it and try to fix it soon enough.

vSKAH commented 10 months ago

@LuyNagda All my leaks are now fixed, so you can merge this branch with your. If you find another problem open new issue ! good day.

vSKAH commented 10 months ago

merged