the issue only happens at the first call of an unknow function, i dunno if that's because valgrind hide the ones that follow.
there is also a related memory leak.
[raphael@fedora 42sh]$ valgrind --leak-check=full --show-leak-kinds=all ./42sh
==13192== Memcheck, a memory error detector
==13192== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==13192== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==13192== Command: ./42sh
==13192==
$> oui
==13192== Conditional jump or move depends on uninitialised value(s)
==13192== at 0x40325C: get_bin_path (get_cmd_path.c:59)
==13192== by 0x40336D: get_cmd_path (get_cmd_path.c:74)
==13192== by 0x403FB5: run_pipeline (run_pipeline.c:97)
==13192== by 0x4017EA: mysh (mysh.c:43)
==13192== by 0x4015D6: main (main.c:58)
==13192==
oui: Command not found.
$> exit
==13192==
==13192== HEAP SUMMARY:
==13192== in use at exit: 20 bytes in 1 blocks
==13192== total heap usage: 67 allocs, 66 frees, 256,229 bytes allocated
==13192==
==13192== 20 bytes in 1 blocks are still reachable in loss record 1 of 1
==13192== at 0x484586F: malloc (vg_replace_malloc.c:381)
==13192== by 0x4054F6: ice_realloc2 (in /home/raphael/delivery/unix_system_programing/42sh/42sh)
==13192== by 0x403092: compose_path (get_cmd_path.c:38)
==13192== by 0x403241: get_bin_path (get_cmd_path.c:60)
==13192== by 0x40336D: get_cmd_path (get_cmd_path.c:74)
==13192== by 0x403FB5: run_pipeline (run_pipeline.c:97)
==13192== by 0x4017EA: mysh (mysh.c:43)
==13192== by 0x4015D6: main (main.c:58)
==13192==
==13192== LEAK SUMMARY:
==13192== definitely lost: 0 bytes in 0 blocks
==13192== indirectly lost: 0 bytes in 0 blocks
==13192== possibly lost: 0 bytes in 0 blocks
==13192== still reachable: 20 bytes in 1 blocks
==13192== suppressed: 0 bytes in 0 blocks
==13192==
==13192== Use --track-origins=yes to see where uninitialised values come from
==13192== For lists of detected and suppressed errors, rerun with: -s
==13192== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)