From 94bc38df829c4816e629c7dcaed31b1e7c75bc4b Mon Sep 17 00:00:00 2001 From: gramanas Date: Mon, 16 Apr 2018 14:34:30 +0300 Subject: Add asan option to cmake finish init without any asan warnings --- src/ck.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/ck.c') diff --git a/src/ck.c b/src/ck.c index 2833176..61797b4 100644 --- a/src/ck.c +++ b/src/ck.c @@ -11,21 +11,24 @@ int main(int argc, char *argv[]) { UserOpt opt; switch(parseAction(argc, argv, &opt)) { case OPR_HELP: + free_user_opt(&opt); printParserHelp(); + return 0; case OPR_ERR: printParserError(&opt); + free_user_opt(&opt); + return 1; case OPR_OK: break; } - printf("%s\n", opt.confDir); Conf conf; if (opt.action != CKA_INIT) { - if (!db_exists()) { - printf("ck is not initialized.\nRun ck init first.\n"); + if (!db_exists(&opt)) { + printf("ck is not initialized in %s.\nRun ck init first.\n", opt.confDir); return 1; } - if (!config_file_parse(&conf)) { + if (!config_file_parse(&conf, &opt)) { return 1; } } @@ -48,5 +51,6 @@ int main(int argc, char *argv[]) { CK_ACTIONS #undef X } + free_user_opt(&opt); return 0; } -- cgit v1.2.3