diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2009-09-17 16:04:45 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-09-21 11:44:51 -0400 |
commit | c8afa2d4bd5ecd6cf5f4dc5d0cbedb9470ce848a (patch) | |
tree | a75b3f812038497bcad944f0bc3879272b9e6717 /elapi/elapi_internal.c | |
parent | c5a0363437783d27140bd359ce59f5a92a879d07 (diff) | |
download | ding-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_internal.c')
-rw-r--r-- | elapi/elapi_internal.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/elapi/elapi_internal.c b/elapi/elapi_internal.c index 7eec6fa..d0fd48d 100644 --- a/elapi/elapi_internal.c +++ b/elapi/elapi_internal.c @@ -242,19 +242,12 @@ int elapi_tgt_create(struct elapi_tgt_ctx **context, } /* Allocate context */ - target_context = (struct elapi_tgt_ctx *)malloc(sizeof(struct elapi_tgt_ctx)); + target_context = (struct elapi_tgt_ctx *)calloc(1, sizeof(struct elapi_tgt_ctx)); if (target_context == NULL) { TRACE_ERROR_NUMBER("Memory allocation failed. Error", ENOMEM); return ENOMEM; } - /* Initialize the allocatable items so that we can call destroy function - * in case of error. - * FIXME - add initialization here for other elements as they are added. - */ - - target_context->sink_ref_list = NULL; - /* Assign target's value */ error = get_config_item(target, ELAPI_TARGET_VALUE, |