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 | 8a01230d3b5c048658e2157c6ff68b3680aafd26 (patch) | |
tree | fc600a79cb4bfcf0f23c9b36d5ebf00efc27fe97 /common/elapi/elapi_internal.c | |
parent | 1016af2b1b97ad4290ccce8fa462cc7e3c191b2e (diff) | |
download | sssd-8a01230d3b5c048658e2157c6ff68b3680aafd26.tar.gz sssd-8a01230d3b5c048658e2157c6ff68b3680aafd26.tar.xz sssd-8a01230d3b5c048658e2157c6ff68b3680aafd26.zip |
ELAPI: Ticket 161: Initialize structures with calloc instead of enumerating members
Diffstat (limited to 'common/elapi/elapi_internal.c')
-rw-r--r-- | common/elapi/elapi_internal.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/common/elapi/elapi_internal.c b/common/elapi/elapi_internal.c index 7eec6faaf..d0fd48dc0 100644 --- a/common/elapi/elapi_internal.c +++ b/common/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, |