Is this the correct fix ?

>From 5805f1d6734b396ad5af6d1dd03170ed5d5884e0 Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <pca...@profusion.mobi>
Date: Fri, 18 Jan 2013 19:02:17 -0200
Subject: [PATCH] efl/eina_cow: Fix memory leak

This patch fixes this leak:

==20662== Memcheck, a memory error detector
==20662== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==20662== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==20662== Command: elementary_test
==20662==
==20662==
==20662== HEAP SUMMARY:
==20662==     in use at exit: 60,087 bytes in 862 blocks
==20662==   total heap usage: 243,341 allocs, 131,829 frees, 64,536,008 bytes allocated
==20662==
==20662== 56 bytes in 1 blocks are definitely lost in loss record 40 of 118
==20662==    at 0x4C2C04B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20662==    by 0xCF32327: eina_hash_new (eina_hash.c:735)
==20662==    by 0xCF6A6E0: eina_cow_add (eina_cow.c:252)
==20662==    by 0xAC3E669: _constructor (evas_object_main.c:50)
==20662==    by 0xCD15928: _eo_op_internal (eo.c:363)
==20662==    by 0xCD15ECC: eo_do_super_internal (eo.c:454)
==20662==    by 0xAC50B05: _constructor (evas_object_smart.c:477)
==20662==    by 0xCD15928: _eo_op_internal (eo.c:363)
==20662==    by 0xCD15ECC: eo_do_super_internal (eo.c:454)
==20662==    by 0x50091CD: _constructor (elm_widget.c:5196)
==20662==    by 0xCD15928: _eo_op_internal (eo.c:363)
==20662==    by 0xCD15ECC: eo_do_super_internal (eo.c:454)
==20662==
==20662== LEAK SUMMARY:
==20662==    definitely lost: 56 bytes in 1 blocks
==20662==    indirectly lost: 0 bytes in 0 blocks
==20662==      possibly lost: 0 bytes in 0 blocks
==20662==    still reachable: 60,031 bytes in 861 blocks
==20662==         suppressed: 0 bytes in 0 blocks

Signed-off-by: Paulo Alcantara <pca...@profusion.mobi>
---
 src/lib/eina/eina_cow.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lib/eina/eina_cow.c b/src/lib/eina/eina_cow.c
index 3048352..f8a1366 100644
--- a/src/lib/eina/eina_cow.c
+++ b/src/lib/eina/eina_cow.c
@@ -285,6 +285,7 @@ eina_cow_del(Eina_Cow *cow)
    EINA_COW_MAGIC_CHECK(cow);
 
    eina_mempool_del(cow->pool);
+   eina_hash_free(cow->match);
 
    EINA_LIST_FREE(cow->togc, gc)
      eina_mempool_free(gc_pool, gc);
-- 
1.8.1.1

Patch is attached.

-- 
Paulo Alcantara,    ProFUSION Embedded Systems
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to