bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8f09cf9dd31c5082b54fd11e934082b1bfb898e3

commit 8f09cf9dd31c5082b54fd11e934082b1bfb898e3
Author: Marcel Hollerbach <[email protected]>
Date:   Tue Mar 24 15:19:23 2020 +0100

    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 <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11577
---
 src/lib/eo/eo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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)

-- 


Reply via email to