summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/md5.c2
-rw-r--r--libglusterfs/src/spec.y1
-rw-r--r--xlators/cluster/stripe/src/stripe.c4
-rw-r--r--xlators/debug/io-stats/src/io-stats.c3
-rw-r--r--xlators/debug/trace/src/trace.c3
5 files changed, 10 insertions, 3 deletions
diff --git a/libglusterfs/src/md5.c b/libglusterfs/src/md5.c
index 6fd6ecbf780..5f0d0d157bf 100644
--- a/libglusterfs/src/md5.c
+++ b/libglusterfs/src/md5.c
@@ -294,6 +294,8 @@ int main(int argc, char *argv[])
while ((i = fread(buf, 1, sizeof buf, f)) > 0)
md5_update(&ctx, buf, i);
+ fclose(f);
+
md5_result(&ctx, md5sum);
for (j = 0; j < MD5_DIGEST_LEN; j++)
diff --git a/libglusterfs/src/spec.y b/libglusterfs/src/spec.y
index e5d68b42106..ec9101a2c21 100644
--- a/libglusterfs/src/spec.y
+++ b/libglusterfs/src/spec.y
@@ -518,6 +518,7 @@ parse_backtick (FILE *srcfp, FILE *dstfp)
result = realloc (result,
2 * cmd_buf_size);
if (result == NULL) {
+ free (cmd);
return -1;
}
}
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 4f676435150..10251e78c68 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -3594,8 +3594,10 @@ set_stripe_block_size (xlator_t *this, stripe_private_t *priv, char *data)
while (stripe_str) {
dup_str = strdup (stripe_str);
stripe_opt = CALLOC (1, sizeof (struct stripe_options));
- if (!stripe_opt)
+ if (!stripe_opt) {
+ FREE (dup_str);
goto out;
+ }
pattern = strtok_r (dup_str, ":", &tmp_str1);
num = strtok_r (NULL, ":", &tmp_str1);
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index 1492c355eda..eb950a33d20 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -1393,7 +1393,7 @@ process_call_list (io_stats_private_t *priv, const char *list, int include)
int32_t
init (xlator_t *this)
{
- dict_t *options = this->options;
+ dict_t *options = NULL;
char *includes = NULL, *excludes = NULL;
io_stats_private_t *priv = NULL;
size_t size = 0;
@@ -1415,6 +1415,7 @@ init (xlator_t *this)
priv = CALLOC (1, sizeof(*priv));
ERR_ABORT (priv);
+ options = this->options;
includes = data_to_str (dict_get (options, "include-ops"));
excludes = data_to_str (dict_get (options, "exclude-ops"));
diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c
index 6fe27c635f9..b4fcf29e1e4 100644
--- a/xlators/debug/trace/src/trace.c
+++ b/xlators/debug/trace/src/trace.c
@@ -2423,7 +2423,7 @@ process_call_list (const char *list, int include)
int32_t
init (xlator_t *this)
{
- dict_t *options = this->options;
+ dict_t *options = NULL;
char *includes = NULL, *excludes = NULL;
if (!this)
@@ -2440,6 +2440,7 @@ init (xlator_t *this)
}
+ options = this->options;
includes = data_to_str (dict_get (options, "include-ops"));
excludes = data_to_str (dict_get (options, "exclude-ops"));