From bcc400cc4e868dd4488b989e895f96248169a414 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Mon, 22 Dec 2014 15:01:36 -0500 Subject: If __wt_getenv fails to allocate memory, we need to fail gracefully. --- src/conn/conn_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c index f87467543d1..3ba9a2bb418 100644 --- a/src/conn/conn_api.c +++ b/src/conn/conn_api.c @@ -1013,9 +1013,11 @@ __conn_config_env(WT_SESSION_IMPL *session, const char *cfg[], WT_ITEM *cbuf) ret = __wt_getenv(session, "WIREDTIGER_CONFIG", &env_config); if (ret == WT_NOTFOUND) return (0); + WT_ERR(ret); + len = strlen(env_config); if (len == 0) - goto err; /* Free the memory */ + goto err; /* Free the memory. */ WT_ERR(__wt_buf_set(session, cbuf, env_config, len + 1)); /* -- cgit v1.2.1