cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1fb06dc09bfa9789597488a1cd6ccef11fc95938

commit 1fb06dc09bfa9789597488a1cd6ccef11fc95938
Author: artem.popov <[email protected]>
Date:   Wed Oct 29 22:33:15 2014 +0100

    eina_unicode: fix memory allocation
    
    Summary:
    there is wrong memory allocation, Eina_Unicode has 4 bytes, allocation
    is like for char
    @fix
    
    Reviewers: Hermet, seoz, raster, cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1609
    
    Signed-off-by: Cedric BAIL <[email protected]>
---
 src/lib/eina/eina_unicode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_unicode.c b/src/lib/eina/eina_unicode.c
index 099af46..c8fddd0 100644
--- a/src/lib/eina/eina_unicode.c
+++ b/src/lib/eina/eina_unicode.c
@@ -163,7 +163,7 @@ eina_unicode_escape(const Eina_Unicode *str)
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(str, NULL);
 
-   s2 = malloc((eina_unicode_strlen(str) * 2) + 1);
+   s2 = malloc(((eina_unicode_strlen(str) * 2) + 1) * sizeof(Eina_Unicode));
    if (!s2)
       return NULL;
 

-- 


Reply via email to