summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-06-01 08:52:19 -0400
committerKeith Bostic <keith@wiredtiger.com>2014-06-01 08:52:19 -0400
commitfa5b47f1f7e1e0fb4a8d5e15f06f8cd154c89c94 (patch)
tree5705ed68f0b8fc4690160cf24ad6c22a78461742
parentdfa12fbde817397ad5c027a5a1aa6b8136641906 (diff)
downloadmongo-fa5b47f1f7e1e0fb4a8d5e15f06f8cd154c89c94.tar.gz
Lint: if realloc fails, the memory has been freed, don't free it twice.
-rw-r--r--src/utilities/util_load.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utilities/util_load.c b/src/utilities/util_load.c
index 4c2a2452075..20421e2a075 100644
--- a/src/utilities/util_load.c
+++ b/src/utilities/util_load.c
@@ -226,6 +226,12 @@ config_read(char ***listp, int *hexp)
if ((tlist = realloc(list, (size_t)
(max_entry += 100) * sizeof(char *))) == NULL) {
ret = util_err(errno, NULL);
+
+ /*
+ * List already freed by realloc, still use err
+ * lable for consistency.
+ */
+ list = NULL;
goto err;
}
list = tlist;