summaryrefslogtreecommitdiffstats
path: root/elapi/elapi_log.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2009-09-17 16:04:45 +0200
committerStephen Gallagher <sgallagh@redhat.com>2009-09-21 11:44:51 -0400
commitc8afa2d4bd5ecd6cf5f4dc5d0cbedb9470ce848a (patch)
treea75b3f812038497bcad944f0bc3879272b9e6717 /elapi/elapi_log.c
parentc5a0363437783d27140bd359ce59f5a92a879d07 (diff)
downloadding-libs-c8afa2d4bd5ecd6cf5f4dc5d0cbedb9470ce848a.tar.gz
ding-libs-c8afa2d4bd5ecd6cf5f4dc5d0cbedb9470ce848a.tar.xz
ding-libs-c8afa2d4bd5ecd6cf5f4dc5d0cbedb9470ce848a.zip
ELAPI: Ticket 161: Initialize structures with calloc instead of enumerating members
Diffstat (limited to 'elapi/elapi_log.c')
-rw-r--r--elapi/elapi_log.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/elapi/elapi_log.c b/elapi/elapi_log.c
index aac1e00..322f5f8 100644
--- a/elapi/elapi_log.c
+++ b/elapi/elapi_log.c
@@ -165,15 +165,12 @@ int elapi_create_dispatcher_adv(struct elapi_dispatcher **dispatcher,
TRACE_INFO_STRING("DIR:", config_dir);
/* Allocate memory */
- handle = (struct elapi_dispatcher *) malloc(sizeof(struct elapi_dispatcher));
+ handle = (struct elapi_dispatcher *) calloc(1, sizeof(struct elapi_dispatcher));
if (handle == NULL) {
TRACE_ERROR_NUMBER("Memory allocation failed. Error", ENOMEM);
return ENOMEM;
}
- /* Clean memory - we need it to be able to destroy the dispatcher at any moment */
- memset(handle, 0, sizeof(struct elapi_dispatcher));
-
/* Save application name in the handle */
if (appname != NULL) handle->appname = strdup(appname);
else handle->appname = strdup(ELAPI_DEFAULT_APP_NAME);