mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 02:36:11 +08:00
libs/libc: posix_spawnattr_init zero-initialize attr
Zero-initialize posix_spawnattr_t in posix_spawnattr_init(). Prevent use of uninitialized fields reported by Coverity. Preserve existing default flag initialization. Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
This commit is contained in:
@@ -61,6 +61,8 @@ int posix_spawnattr_init(posix_spawnattr_t *attr)
|
||||
|
||||
DEBUGASSERT(attr);
|
||||
|
||||
memset(attr, 0, sizeof(*attr));
|
||||
|
||||
/* Flags: None */
|
||||
|
||||
attr->flags = 0;
|
||||
|
||||
Reference in New Issue
Block a user