fix: get_cmdpath will sometimes leak memory

This commit is contained in:
Khaïs COLIN 2025-03-27 16:10:41 +01:00
parent a7b78272ab
commit a5a93be3d0
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo

View file

@ -115,7 +115,7 @@ static char *deal_with_filled_path(char *filename, char **path,
if (tmp)
return (filepath);
else if (!tmp && ft_errno_get() == FT_STATFAIL)
return (NULL);
return (free(filepath), NULL);
i++;
}
path_split_destroy(path);