From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Date: Tue, 22 Dec 2015 17:14:14 +0800 Subject: [U-Boot] [PATCH 1/1] common: env: initialize scalar variable In-Reply-To: <1450775655-2979-1-git-send-email-van.freenix@gmail.com> References: <1450775655-2979-1-git-send-email-van.freenix@gmail.com> Message-ID: <1450775655-2979-2-git-send-email-van.freenix@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Peng Fan Before calling hsearch_r, initialize callback entry to NULL. Signed-off-by: Peng Fan Cc: Tom Rini Cc: Simon Glass --- common/env_callback.c | 1 + common/env_flags.c | 1 + 2 files changed, 2 insertions(+) diff --git a/common/env_callback.c b/common/env_callback.c index f4d3dbd..1957cc1 100644 --- a/common/env_callback.c +++ b/common/env_callback.c @@ -97,6 +97,7 @@ static int set_callback(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? */ diff --git a/common/env_flags.c b/common/env_flags.c index e682d85..7719355 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? */ -- 2.6.2