summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-12-22 15:01:36 -0500
committerKeith Bostic <keith@wiredtiger.com>2014-12-22 15:01:36 -0500
commitbcc400cc4e868dd4488b989e895f96248169a414 (patch)
tree4b59da8f516412f06834c39864c4eb1685038c49
parent45d8cb14404bd5ec9511c47d97338a6bce62dcdf (diff)
downloadmongo-bcc400cc4e868dd4488b989e895f96248169a414.tar.gz
If __wt_getenv fails to allocate memory, we need to fail gracefully.
-rw-r--r--src/conn/conn_api.c4
1 files changed, 3 insertions, 1 deletions
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));
/*