summaryrefslogtreecommitdiffstats
path: root/common/elapi/providers/file/file_provider.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
commit8a01230d3b5c048658e2157c6ff68b3680aafd26 (patch)
treefc600a79cb4bfcf0f23c9b36d5ebf00efc27fe97 /common/elapi/providers/file/file_provider.c
parent1016af2b1b97ad4290ccce8fa462cc7e3c191b2e (diff)
downloadsssd-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/providers/file/file_provider.c')
-rw-r--r--common/elapi/providers/file/file_provider.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/common/elapi/providers/file/file_provider.c b/common/elapi/providers/file/file_provider.c
index 09d6261eb..652e64689 100644
--- a/common/elapi/providers/file/file_provider.c
+++ b/common/elapi/providers/file/file_provider.c
@@ -550,16 +550,12 @@ static int file_create_ctx(struct file_prvdr_ctx **file_ctx,
TRACE_FLOW_STRING("file_create_ctx", "Entry point");
- ctx = (struct file_prvdr_ctx *)malloc(sizeof(struct file_prvdr_ctx));
+ ctx = (struct file_prvdr_ctx *)calloc(1, sizeof(struct file_prvdr_ctx));
if (ctx == NULL) {
TRACE_ERROR_NUMBER("Failed to allocate context", ENOMEM);
return ENOMEM;
}
-
- /* Init allocatable items */
- ctx->config.filename = NULL;
- ctx->config.main_fmt_cfg = NULL;
- ctx->config.lo_fmt_cfg = NULL;
+ /* Init items */
ctx->outfile = -1;
/* Read configuration data */