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)
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,
4614{ 4614{
4615 eina_value_optional_reset(value); 4615 eina_value_optional_reset(value);
4616 4616
4617 if(sizeof(Eina_Value_Optional_Outer) <= sizeof(Eina_Value_Union)) 4617 if (sizeof(Eina_Value_Optional_Outer) <= sizeof(Eina_Value_Union))
4618 { 4618 {
4619 Eina_Value_Optional_Outer outer; 4619 Eina_Value_Optional_Outer outer;
4620 outer.subtype = subtype; 4620 outer.subtype = subtype;
4621 outer.value = malloc(subtype->value_size); 4621 outer.value = malloc(subtype->value_size);
4622 eina_value_type_setup(subtype, outer.value); 4622 if (!eina_value_type_setup(subtype, outer.value))
4623 eina_value_type_pset(subtype, outer.value, subvalue); 4623 return EINA_FALSE;
4624 if (!eina_value_pset(value, &outer)) 4624 eina_value_type_pset(subtype, outer.value, subvalue);
4625 { 4625 if (!eina_value_pset(value, &outer))
4626 return EINA_FALSE; 4626 return EINA_FALSE;
4627 }
4628 } 4627 }
4629 else 4628 else
4630 { 4629 {
4631 Eina_Value_Optional_Inner *inner = 4630 Eina_Value_Optional_Inner *inner =
4632 malloc(sizeof(Eina_Value_Optional_Inner) + subtype->value_size); 4631 malloc(sizeof(Eina_Value_Optional_Inner) + subtype->value_size);
4633 inner->subtype = subtype; 4632 inner->subtype = subtype;
4634 eina_value_type_setup(subtype, inner->value); 4633 if (!eina_value_type_setup(subtype, inner->value))
4634 return EINA_FALSE;
4635 eina_value_type_pset(subtype, inner->value, subvalue); 4635 eina_value_type_pset(subtype, inner->value, subvalue);
4636 if (!eina_value_pset(value, &inner)) 4636 if (!eina_value_pset(value, &inner))
4637 return EINA_FALSE; 4637 return EINA_FALSE;
4638 } 4638 }
4639 4639
4640 return EINA_TRUE; 4640 return EINA_TRUE;