summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-24 15:19:23 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-24 20:41:27 +0100
commit8f09cf9dd31c5082b54fd11e934082b1bfb898e3 (patch)
tree867209f88da5ee8b405b56b97cfe1e2191f2a8a6
parent9762d75dc4efaa380305aaff9c51b9b4ca069b7c (diff)
downloadefl-8f09cf9dd31c5082b54fd11e934082b1bfb898e3.tar.gz
eo: only really copy when there is content
otherwise we are allocating a 0 sized memory element, which is pointless. ASAN would report a 0 sized allocated but not freed element as a leak. Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11577
-rw-r--r--src/lib/eo/eo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index f7691e353d..e0b2d464fb 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -285,7 +285,10 @@ _vtable_merge_defined_api(Eo_Vtable *dest, const Eo_Vtable *src, Eina_Bool *hitm
if (!hitmap[i])
{
const Eo_Vtable_Node node = dest->chain[i];
- _vtable_copy_node(&dest->chain[i], &node); //we copy what we have, and overwrite in the later for loop
+ if (!node.count)
+ _vtable_insert_empty_funcs(dest, i);
+ else
+ _vtable_copy_node(&dest->chain[i], &node); //we copy what we have, and overwrite in the later for loop
hitmap[i] = EINA_TRUE;
}
for (int j = 0; j < src->chain[i].count; ++j)