]> Kevux Git Server - fll/commit
Security: The realpath() calls malloc() and free() is not called (memory leak).
authorKevin Day <thekevinday@gmail.com>
Wed, 18 May 2022 02:48:50 +0000 (21:48 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 18 May 2022 03:02:41 +0000 (22:02 -0500)
commit8bb9c4bca207462b44f22e993a007bad7e175077
treeb20c8e7ce1fc8b00650d5dca3554fa02d7ced1af
parent32a125976161e87e38541b7cdf96141b0d63149a
Security: The realpath() calls malloc() and free() is not called (memory leak).

I change the code and didn't realize that realpath() conditionally calls malloc().
When I change th code to pass a variable initialized to 0, I ended up triggering realpath() to call malloc().
This results in a memory leak.

Instead, pass a statically allocated array.
level_0/f_path/c/private-path.c