summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/authenticate.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-04-13 17:29:41 +0530
committerAnand Avati <avati@redhat.com>2012-04-23 14:52:57 -0700
commit29f2de478cc6a475e6ae760d9cbe7ac847e9d79c (patch)
tree621fbb33e6e3de20f7c1b59a98e181c7b50b4796 /xlators/protocol/server/src/authenticate.c
parent4c9e8fad23836d87b0c4327e990c789630fe5b97 (diff)
core: coverity issues fixed
this is not a complete set of issues getting fixed. Will address other issues in another patch. Change-Id: Ib01c7b11b205078cc4d0b3f11610751e32d14b69 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 789278 Reviewed-on: http://review.gluster.com/3145 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/authenticate.c')
-rw-r--r--xlators/protocol/server/src/authenticate.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/xlators/protocol/server/src/authenticate.c b/xlators/protocol/server/src/authenticate.c
index de5bf9f43..ffadf2e4d 100644
--- a/xlators/protocol/server/src/authenticate.c
+++ b/xlators/protocol/server/src/authenticate.c
@@ -34,12 +34,12 @@
static void
init (dict_t *this, char *key, data_t *value, void *data)
{
- void *handle = NULL;
- char *auth_file = NULL;
- auth_handle_t *auth_handle = NULL;
- auth_fn_t authenticate = NULL;
- int *error = NULL;
- int ret = 0;
+ void *handle = NULL;
+ char *auth_file = NULL;
+ auth_handle_t *auth_handle = NULL;
+ auth_fn_t authenticate = NULL;
+ int *error = NULL;
+ int ret = 0;
/* It gets over written */
error = data;
@@ -78,6 +78,7 @@ init (dict_t *this, char *key, data_t *value, void *data)
gf_log ("authenticate", GF_LOG_ERROR,
"dlsym(gf_auth) on %s\n", dlerror ());
dict_set (this, key, data_from_dynptr (NULL, 0));
+ dlclose (handle);
*error = -1;
return;
}
@@ -87,10 +88,17 @@ init (dict_t *this, char *key, data_t *value, void *data)
if (!auth_handle) {
dict_set (this, key, data_from_dynptr (NULL, 0));
*error = -1;
+ dlclose (handle);
return;
}
auth_handle->vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t),
gf_common_mt_volume_opt_list_t);
+ if (!auth_handle->vol_opt) {
+ dict_set (this, key, data_from_dynptr (NULL, 0));
+ *error = -1;
+ dlclose (handle);
+ return;
+ }
auth_handle->vol_opt->given_opt = dlsym (handle, "options");
if (auth_handle->vol_opt->given_opt == NULL) {
gf_log ("authenticate", GF_LOG_DEBUG,