Shell 564ca848f4 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 <smokewood@qq.com>
2024-08-24 15:46:35 -04:00
..
2024-03-28 23:42:56 +08:00
2024-03-28 23:42:56 +08:00
2022-12-03 12:07:44 +08:00
2022-12-03 12:07:44 +08:00
2022-12-03 12:07:44 +08:00
2024-03-28 23:42:56 +08:00
2024-02-23 17:49:15 +08:00
2023-11-10 21:37:07 +08:00
2024-02-23 17:49:15 +08:00
2024-03-28 23:42:56 +08:00
2022-12-03 12:07:44 +08:00
2022-12-03 12:07:44 +08:00
2024-03-28 23:42:56 +08:00
2024-03-28 23:42:56 +08:00
2023-10-17 13:07:59 +08:00
2022-12-03 12:07:44 +08:00
2024-03-28 23:42:56 +08:00
2024-03-28 23:42:56 +08:00
2024-03-28 23:42:56 +08:00
2024-08-24 14:44:39 +08:00
2024-03-28 23:42:56 +08:00
2023-10-17 13:07:59 +08:00