cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7c615e183110f26bf6ea1671848cdaae6adfa130

commit 7c615e183110f26bf6ea1671848cdaae6adfa130
Author: Cedric BAIL <[email protected]>
Date:   Mon Nov 13 14:12:42 2017 -0800

    edje: cleanup life cycle of buffer in _edje_hash_find_helper.
---
 src/lib/edje/edje_util.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index da5c3cb069..fc0015eac9 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -5343,7 +5343,6 @@ _edje_hash_find_helper(const Eina_Hash *hash, const char 
*key)
    int i, j;
    char **tokens;
    unsigned int tokens_count = 0;
-   Eina_Strbuf *buf = NULL;
 
    data = eina_hash_find(hash, key);
    if (data)
@@ -5353,6 +5352,8 @@ _edje_hash_find_helper(const Eina_Hash *hash, const char 
*key)
 
    if ((tokens) && (tokens_count > 1))
      {
+        Eina_Strbuf *buf = NULL;
+
         buf = eina_strbuf_new();
 
         for (i = tokens_count - 2; i >= 0; i--)
@@ -5369,12 +5370,10 @@ _edje_hash_find_helper(const Eina_Hash *hash, const 
char *key)
 
              eina_strbuf_reset(buf);
           }
-     }
 
-   if (buf)
-     {
         eina_strbuf_free(buf);
      }
+
    if (tokens)
      {
         free(tokens[0]);

-- 


Reply via email to