summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristopher Michael <devilhorns@comcast.net>2021-02-25 09:23:23 -0500
committerChristopher Michael <devilhorns@comcast.net>2021-02-25 09:23:23 -0500
commit732e622a8205f2d21032d1c74417331309fc5bab (patch)
tree6060e5dd52324630fcdd0e9584378b2c4766788e /src/lib
parent3a07f18294e73f0b306077861d7b54a06130fc06 (diff)
downloadefl-732e622a8205f2d21032d1c74417331309fc5bab.tar.gz
eina_value: Fix unchecked return value
Small patch to check return value of eina_value_type_setup reported by Coverity Fixes CID1401023
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/eina/eina_value.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c
index 3cf4c06ab2..4045124775 100644
--- a/src/lib/eina/eina_value.c
+++ b/src/lib/eina/eina_value.c
@@ -4614,27 +4614,27 @@ eina_value_optional_pset(Eina_Value *value,
{
eina_value_optional_reset(value);
- if(sizeof(Eina_Value_Optional_Outer) <= sizeof(Eina_Value_Union))
+ if (sizeof(Eina_Value_Optional_Outer) <= sizeof(Eina_Value_Union))
{
- Eina_Value_Optional_Outer outer;
- outer.subtype = subtype;
- outer.value = malloc(subtype->value_size);
- eina_value_type_setup(subtype, outer.value);
- eina_value_type_pset(subtype, outer.value, subvalue);
- if (!eina_value_pset(value, &outer))
- {
- return EINA_FALSE;
- }
+ Eina_Value_Optional_Outer outer;
+ outer.subtype = subtype;
+ outer.value = malloc(subtype->value_size);
+ if (!eina_value_type_setup(subtype, outer.value))
+ return EINA_FALSE;
+ eina_value_type_pset(subtype, outer.value, subvalue);
+ if (!eina_value_pset(value, &outer))
+ return EINA_FALSE;
}
else
{
Eina_Value_Optional_Inner *inner =
malloc(sizeof(Eina_Value_Optional_Inner) + subtype->value_size);
inner->subtype = subtype;
- eina_value_type_setup(subtype, inner->value);
+ if (!eina_value_type_setup(subtype, inner->value))
+ return EINA_FALSE;
eina_value_type_pset(subtype, inner->value, subvalue);
if (!eina_value_pset(value, &inner))
- return EINA_FALSE;
+ return EINA_FALSE;
}
return EINA_TRUE;