jpeg pushed a commit to branch master.

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

commit f1aa32a4a45cdce9994d0c8bbcf1c0860f892657
Author: Jean-Philippe Andre <[email protected]>
Date:   Mon Jan 13 11:44:21 2014 +0900

    Evas/cserve2: Use calloc instead of malloc
    
    This will silence some warnings from valgrind (and add some
    safety as well...)
---
 src/bin/evas/evas_cserve2_cache.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bin/evas/evas_cserve2_cache.c 
b/src/bin/evas/evas_cserve2_cache.c
index 3b04245..bc12fed 100644
--- a/src/bin/evas/evas_cserve2_cache.c
+++ b/src/bin/evas/evas_cserve2_cache.c
@@ -1889,7 +1889,7 @@ _glyphs_loaded_msg_create(Glyphs_Request *req, int 
*resp_size)
    size += shmname_size + idxname_size;
    size += req->nanswer * 10 * sizeof(int);
 
-   response = malloc(size);
+   response = calloc(1, size);
    if (!response) return NULL;
    msg = (Msg_Font_Glyphs_Loaded *) response;
    buf = response + sizeof(Msg_Font_Glyphs_Loaded);
@@ -1979,7 +1979,7 @@ _file_path_join(const char *path, const char *end)
    len = strlen(path);
    len += strlen(end);
    len += strlen(EVAS_PATH_SEPARATOR);
-   res = malloc(len + 1);
+   res = calloc(1, len + 1);
    if (!res) return NULL;
    strcpy(res, path);
    strcat(res, EVAS_PATH_SEPARATOR);
@@ -2056,7 +2056,7 @@ _glyphs_load_request_prepare(Glyphs_Request *req)
 
    // Won't render more than this number of glyphs
    max = req->nglyphs - req->nanswer;
-   req->render = malloc(sizeof(*req->render) * max);
+   req->render = calloc(max, sizeof(*req->render));
 
    for (i = req->current; i < req->nglyphs; i++)
      {

-- 


Reply via email to