summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2014-11-28 17:54:52 +0530
committerVijay Bellur <vbellur@redhat.com>2014-12-09 20:11:17 -0800
commitecb58c9a3f716a87da7174c1aa721561b18ad27b (patch)
tree13746f56975cabf0feaa01216099a6712427f07d /glusterfsd
parent4aa63e28509eb47d293eddb4f61317d409598c23 (diff)
api, glusterfsd: Cleanup upon failure in glusterfs_ctx_defaults_init()
This got introduced due to 656711d935000c16. Coverity also picked this up as CIDs 1256176, 1256178, 1256180. Signed-off-by: Vijay Bellur <vbellur@redhat.com> Change-Id: If12fa0075634383975846181917a2f9650f790e3 BUG: 789278 Reviewed-on: http://review.gluster.org/9213 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index c23e832..e854959 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -1319,6 +1319,12 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx)
gf_msg(THIS->name, GF_LOG_CRITICAL, 0, glusterfsd_msg_34);
return ret;
}
+
+ /* reset ret to -1 so that we don't need to explicitly
+ * set it in all error paths before "goto err"
+ */
+ ret = -1;
+
ctx->process_uuid = generate_glusterfs_ctx_id ();
if (!ctx->process_uuid) {
gf_msg ("", GF_LOG_CRITICAL, 0, glusterfsd_msg_13);