summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/dict.c2
-rw-r--r--libglusterfs/src/run.c8
-rw-r--r--libglusterfs/src/statedump.c3
-rw-r--r--libglusterfs/src/xlator.c3
4 files changed, 14 insertions, 2 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index 8048414705b..5ae61fd3d3b 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -265,6 +265,8 @@ _dict_set (dict_t *this,
if (this->free_pair_in_use) {
pair = mem_get0 (THIS->ctx->dict_pair_pool);
if (!pair) {
+ if (key_free)
+ GF_FREE (key);
return -1;
}
}
diff --git a/libglusterfs/src/run.c b/libglusterfs/src/run.c
index 34d75df69c2..50c1e30bfc6 100644
--- a/libglusterfs/src/run.c
+++ b/libglusterfs/src/run.c
@@ -67,7 +67,10 @@ runner_chio (runner_t *runner, int fd)
{
GF_ASSERT (fd > 0 && fd < 3);
- return runner->chio[fd];
+ if ((fd > 0) && (fd < 3))
+ return runner->chio[fd];
+
+ return NULL;
}
static void
@@ -194,7 +197,8 @@ runner_redir (runner_t *runner, int fd, int tgt_fd)
{
GF_ASSERT (fd > 0 && fd < 3);
- runner->chfd[fd] = (tgt_fd >= 0) ? tgt_fd : -2;
+ if ((fd > 0) && (fd < 3))
+ runner->chfd[fd] = (tgt_fd >= 0) ? tgt_fd : -2;
}
int
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c
index 899d8ef2b1b..6941468747e 100644
--- a/libglusterfs/src/statedump.c
+++ b/libglusterfs/src/statedump.c
@@ -608,6 +608,9 @@ gf_proc_dump_options_init ()
}
+ if (fp)
+ fclose (fp);
+
return 0;
}
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index 470087df9c9..7c081fa5568 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -168,6 +168,9 @@ xlator_volopt_dynload (char *xlator_type, void **dl_handle,
ret = 0;
out:
+ if (name)
+ GF_FREE (name);
+
gf_log ("xlator", GF_LOG_DEBUG, "Returning %d", ret);
return ret;