summaryrefslogtreecommitdiff
path: root/src/utilities/util_stat.c
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2013-11-16 08:50:08 -0500
committerKeith Bostic <keith@wiredtiger.com>2013-11-16 08:50:08 -0500
commitca417ce47f2f98126d1f3d0badec348bf71e8856 (patch)
tree9d6dac78de2b09bc11e119ee5af01bc3da91ed4e /src/utilities/util_stat.c
parentb2f138598abe014c844f222a3f7c9090b554dd6d (diff)
downloadmongo-ca417ce47f2f98126d1f3d0badec348bf71e8856.tar.gz
Coverity: Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "objname" going out of scope leaks the storage it points to.
Diffstat (limited to 'src/utilities/util_stat.c')
-rw-r--r--src/utilities/util_stat.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/utilities/util_stat.c b/src/utilities/util_stat.c
index 1286896195b..cb13ddc266d 100644
--- a/src/utilities/util_stat.c
+++ b/src/utilities/util_stat.c
@@ -54,7 +54,7 @@ util_stat(WT_SESSION *session, int argc, char *argv[])
urilen = strlen("statistics:") + strlen(objname) + 1;
if ((uri = calloc(urilen, 1)) == NULL) {
fprintf(stderr, "%s: %s\n", progname, strerror(errno));
- return (1);
+ goto err;
}
snprintf(uri, urilen, "statistics:%s", objname);
@@ -82,7 +82,10 @@ util_stat(WT_SESSION *session, int argc, char *argv[])
goto err;
}
-err: if (objname_free)
+ if (0) {
+err: ret = 1;
+ }
+ if (objname_free)
free(objname);
free(uri);