diff options
author | David Hows <howsdav@gmail.com> | 2015-12-15 17:40:17 +1100 |
---|---|---|
committer | David Hows <howsdav@gmail.com> | 2015-12-15 17:40:17 +1100 |
commit | 7c61d52236ebbb70040ba4adac84ca298c152cf6 (patch) | |
tree | 9bca9f944db81e59ba63ab5be02c2bffb46a8b22 /bench | |
parent | 373058a3eb3d2fdd48efe906fe26a63a5d8a65fa (diff) | |
download | mongo-7c61d52236ebbb70040ba4adac84ca298c152cf6.tar.gz |
WT-2269 - Fix uninitalized use of file pointer in error path
Diffstat (limited to 'bench')
-rw-r--r-- | bench/wtperf/config.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bench/wtperf/config.c b/bench/wtperf/config.c index a4d43c9de64..6dcc15553b0 100644 --- a/bench/wtperf/config.c +++ b/bench/wtperf/config.c @@ -685,6 +685,8 @@ config_to_file(CONFIG *cfg) size_t req_len; char *path; + fp = NULL; + /* Backup the config */ req_len = strlen(cfg->home) + 100; if ((path = calloc(req_len, 1)) == NULL) { @@ -706,8 +708,8 @@ config_to_file(CONFIG *cfg) } err: free(path); - if (fp) - fclose(fp); + if (fp != NULL) + (void)fclose(fp); } /* |