From b71f1d2e8f7ad6853e5e68134a66baf9dea2471b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 17 Oct 2012 11:26:04 -0400 Subject: [PATCH 09/36] Only try to register OIDs once. Signed-off-by: Peter Jones --- src/cms_common.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cms_common.c b/src/cms_common.c index 2d51979..6219a2a 100644 --- a/src/cms_common.c +++ b/src/cms_common.c @@ -179,11 +179,15 @@ cms_common_log(cms_context *ctx, int priority, char *fmt, ...) int cms_context_init(cms_context *cms) { + static int first_time = 1; memset(cms, '\0', sizeof (*cms)); - SECStatus status = register_oids(cms); - if (status != SECSuccess) - return -1; + if (first_time) { + SECStatus status = register_oids(cms); + if (status != SECSuccess) + return -1; + first_time = 0; + } cms->log = cms_common_log; -- 1.7.12.1