From 5a6894397a657edec5d0cf4e20968cc66a368c51 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 23 Dec 2015 12:07:24 +0800 Subject: 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 Cc: Tom Rini Cc: Simon Glass --- common/env_flags.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common/env_flags.c') diff --git a/common/env_flags.c b/common/env_flags.c index e682d85178..771935508c 100644 --- a/common/env_flags.c +++ b/common/env_flags.c @@ -455,6 +455,7 @@ static int set_flags(const char *name, const char *value, void *priv) e.key = name; e.data = NULL; + e.callback = NULL; hsearch_r(e, FIND, &ep, &env_htab, 0); /* does the env variable actually exist? */ -- cgit v1.2.1