Apply memset-calloc.cocci
authorlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 13 Aug 2010 12:53:08 +0000 (12:53 +0000)
committerlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 13 Aug 2010 12:53:08 +0000 (12:53 +0000)
Change calls to malloc + memset to calloc whenever an automatic conversion can
be done.

Possible candidates are not treated here, only the ones we can be sure the
conversion is safe.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@51078 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_config/ecore_config_ipc_main.c

index b152649..a8ecdc6 100644 (file)
@@ -251,8 +251,7 @@ _ecore_config_ipc_init(const char *pipe_name)
    ret_srv = NULL;
    list = NULL;
 
-   list = malloc(sizeof(Ecore_Config_Server));
-   memset(list, 0, sizeof(Ecore_Config_Server));
+   list = calloc(1, sizeof(Ecore_Config_Server));
    if ((ret = _ecore_config_ipc_ecore_init(pipe_name, &list->server)) != ECORE_CONFIG_ERR_SUCC)
      {
        ERR("_ecore_config_ipc_init: failed to register %s, code %d",