From a6128d64ec4c25eba002941ae68a9e9a72805704 Mon Sep 17 00:00:00 2001 From: Susant Palai Date: Wed, 3 Oct 2018 21:09:15 +0530 Subject: libglusterfs: coverity fix CID: 1395829 Issue: Uninitialized pointer read Change-Id: I2e03d7b2a2f28f4a46408402ae03beba0f4c8308 Updates: bz#789278 Signed-off-by: Susant Palai --- libglusterfs/src/monitoring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/monitoring.c b/libglusterfs/src/monitoring.c index 316875257cc..245f1baf799 100644 --- a/libglusterfs/src/monitoring.c +++ b/libglusterfs/src/monitoring.c @@ -228,7 +228,7 @@ gf_monitor_metrics(glusterfs_ctx_t *ctx) { int ret = -1; int fd = 0; - char *filepath, *dumppath; + char *filepath = NULL, *dumppath = NULL; dumppath = ctx->config.metrics_dumppath; if (dumppath == NULL) { @@ -238,7 +238,7 @@ gf_monitor_metrics(glusterfs_ctx_t *ctx) if (ret) { /* EEXIST is handled in mkdir_p() itself */ gf_msg("monitoring", GF_LOG_ERROR, 0, LG_MSG_STRDUP_ERROR, - "failed to create metrics dir %s (%s)", filepath, + "failed to create metrics dir %s (%s)", dumppath, strerror(errno)); return NULL; } -- cgit