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)
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
285 if (!hitmap[i]) 285 if (!hitmap[i])
286 { 286 {
287 const Eo_Vtable_Node node = dest->chain[i]; 287 const Eo_Vtable_Node node = dest->chain[i];
288 _vtable_copy_node(&dest->chain[i], &node); //we copy what we have, and overwrite in the later for loop 288 if (!node.count)
289 _vtable_insert_empty_funcs(dest, i);
290 else
291 _vtable_copy_node(&dest->chain[i], &node); //we copy what we have, and overwrite in the later for loop
289 hitmap[i] = EINA_TRUE; 292 hitmap[i] = EINA_TRUE;
290 } 293 }
291 for (int j = 0; j < src->chain[i].count; ++j) 294 for (int j = 0; j < src->chain[i].count; ++j)