summaryrefslogtreecommitdiff
path: root/include/rtklibc.h
diff options
context:
space:
mode:
authorShell <[email protected]>2024-08-21 18:10:25 +0800
committerMeco Man <[email protected]>2024-08-24 15:46:35 -0400
commit564ca848f428f7be6aa2372ff8666c1d7883e1b5 (patch)
tree73aa52a2d476f849730e571d3009f66efb29c1c2 /include/rtklibc.h
parentd6d675262752a704b7ea725781a4687ad70feff5 (diff)
fixup: uninitialized argument vector element
This patch addresses the potential issue of uninitialized elements in the argument vector returned by `lwp_get_command_line_args()`. The previous implementation could leave `argv` in an inconsistent state if certain errors occurred, leading to possible undefined behavior. Changes: - Replaced `rt_malloc()` with `rt_calloc()` to ensure `argv` is properly initialized. - Added a consistent error handling path using `goto error_exit` to handle memory allocation failures and string copy errors. - Ensured `lwp_free_command_line_args()` is called before returning on error, preventing potential memory leaks. Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'include/rtklibc.h')
0 files changed, 0 insertions, 0 deletions