common: env: initialize scalar variable
Before calling hsearch_r, initialize callback entry to NULL. Coverity log: " Uninitialized scalar variable (UNINIT) uninit_use_in_call: Using uninitialized value e. Field e.callback is uninitialized when calling hsearch_r. " Reported-by: Coverity Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
09a788624d
commit
5a6894397a
@ -97,6 +97,7 @@ static int set_callback(const char *name, const char *value, void *priv)
|
|||||||
|
|
||||||
e.key = name;
|
e.key = name;
|
||||||
e.data = NULL;
|
e.data = NULL;
|
||||||
|
e.callback = NULL;
|
||||||
hsearch_r(e, FIND, &ep, &env_htab, 0);
|
hsearch_r(e, FIND, &ep, &env_htab, 0);
|
||||||
|
|
||||||
/* does the env variable actually exist? */
|
/* does the env variable actually exist? */
|
||||||
|
@ -455,6 +455,7 @@ static int set_flags(const char *name, const char *value, void *priv)
|
|||||||
|
|
||||||
e.key = name;
|
e.key = name;
|
||||||
e.data = NULL;
|
e.data = NULL;
|
||||||
|
e.callback = NULL;
|
||||||
hsearch_r(e, FIND, &ep, &env_htab, 0);
|
hsearch_r(e, FIND, &ep, &env_htab, 0);
|
||||||
|
|
||||||
/* does the env variable actually exist? */
|
/* does the env variable actually exist? */
|
||||||
|
Loading…
Reference in New Issue
Block a user