diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-04-22 14:02:24 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2016-04-22 14:02:24 +1000 |
commit | 3a6488a12d339b1bb8a1ff3eb015f08327be855a (patch) | |
tree | a8ac0db30d9893ed64d4ccc5d334df791478b2c2 /test | |
parent | f498d8c1c1d3fbbb6cb44c16fa85ab0de2a4aafc (diff) | |
parent | cda4840c4ba7ce44bca6c4390061b02d4a3de522 (diff) | |
download | mongo-3a6488a12d339b1bb8a1ff3eb015f08327be855a.tar.gz |
Merge pull request #2684 from wiredtiger/wt-2574-free-dup-config
WT-2574 Ensure test/format doesn't leak memory
Diffstat (limited to 'test')
-rw-r--r-- | test/format/config.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/format/config.c b/test/format/config.c index 1f9e2e1b353..1fe50759a95 100644 --- a/test/format/config.c +++ b/test/format/config.c @@ -623,6 +623,15 @@ config_single(const char *s, int perm) exit(EXIT_FAILURE); } + /* + * Free the previous setting if a configuration has been + * passed in twice. + */ + if (*cp->vstr != NULL) { + free(*cp->vstr); + *cp->vstr = NULL; + } + if (strncmp(s, "checksum", strlen("checksum")) == 0) { config_map_checksum(ep, &g.c_checksum_flag); *cp->vstr = strdup(ep); |