aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@free.fr>2019-09-14 19:13:04 -0700
committerCedric Bail <cedric.bail@free.fr>2019-09-17 10:24:08 -0700
commit94e9363649fa416ba359a97c50a8d57789898517 (patch)
tree0ece2fd74569b59899cf44d3ee636f699b094258
parenteina: turn on Eina_Mempool tests for OneBig too. (diff)
downloadefl-94e9363649fa416ba359a97c50a8d57789898517.tar.gz
eina: prevent leak of Eina_Value internal allocation.
eina_value_copy assume the given Eina_Value as target is not initialized when it copy the source in it. In eina_value_reference_copy we were initialising before calling eina_value_copy which would then override and leak the internal pointer no fault of the users. Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9943
-rw-r--r--src/lib/eina/eina_inline_value_util.x3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/eina/eina_inline_value_util.x b/src/lib/eina/eina_inline_value_util.x
index 09a7996087..17710a8cd7 100644
--- a/src/lib/eina/eina_inline_value_util.x
+++ b/src/lib/eina/eina_inline_value_util.x
@@ -327,8 +327,7 @@ eina_value_reference_copy(const Eina_Value *val)
{
Eina_Value v = EINA_VALUE_EMPTY;
- if (!eina_value_setup(&v, eina_value_type_get(val)) ||
- !eina_value_copy(val, &v))
+ if (!eina_value_copy(val, &v))
{
eina_value_setup(&v, EINA_VALUE_TYPE_ERROR);
eina_value_set(&v, EINA_ERROR_VALUE_FAILED);