summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-combine.c
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2014-07-16 13:50:53 +0200
committerVijay Bellur <vbellur@redhat.com>2014-07-21 18:39:46 -0700
commit464ff8f7592e7d6a9239ca1fab1928d4a608f253 (patch)
treeede9747e4b9c79ad0da3598eb43ff922d132e3dc /xlators/cluster/ec/src/ec-combine.c
parentf6ddb4675c096dc81420ed84fb2a6fefa9fea563 (diff)
ec: Fixed coveriry scan issues
CID list: 1226163 Logically dead code 1226166 Missing break in switch 1226167 Missing break in switch 1226168 Missing break in switch 1226169 Missing break in switch 1226170 Missing break in switch 1226171 Missing break in switch 1226172 Missing break in switch 1226173 Missing break in switch 1226174 Missing break in switch 1226175 Missing break in switch 1226176 Missing break in switch 1226177 Missing break in switch 1226178 Data race condition 1226179 Data race condition 1226180 Data race condition 1226181 Thread deadlock 1226182 Uninitialized pointer read 1226183 Uninitialized pointer read 1226184 Read from pointer after free Change-Id: I4d33aa42289371927175c43bb29e018df64fb943 BUG: 789278 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8317 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-combine.c')
-rw-r--r--xlators/cluster/ec/src/ec-combine.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/xlators/cluster/ec/src/ec-combine.c b/xlators/cluster/ec/src/ec-combine.c
index 07d819a9a3d..3d088d9be4a 100644
--- a/xlators/cluster/ec/src/ec-combine.c
+++ b/xlators/cluster/ec/src/ec-combine.c
@@ -366,18 +366,26 @@ int32_t ec_dict_data_merge(ec_cbk_data_t * cbk, int32_t which, char * key)
return -1;
}
- if (dict_unserialize(data[0]->data, data[0]->len, &lockinfo) != 0)
+ lockinfo = dict_new();
+ if (lockinfo == NULL)
{
return -1;
}
+ if (dict_unserialize(data[0]->data, data[0]->len, &lockinfo) != 0)
+ {
+ goto out;
+ }
+
for (i = 1; i < num; i++)
{
- if (dict_unserialize(data[i]->data, data[i]->len, &tmp) != 0)
+ tmp = dict_new();
+ if (tmp == NULL)
{
goto out;
}
- if (dict_copy(tmp, lockinfo) == NULL)
+ if ((dict_unserialize(data[i]->data, data[i]->len, &tmp) != 0) ||
+ (dict_copy(tmp, lockinfo) == NULL))
{
dict_unref(tmp);