diff options
author | tb <> | 2024-03-20 21:31:31 +0000 |
---|---|---|
committer | tb <> | 2024-03-20 21:31:31 +0000 |
commit | f1380ec05ac6100b94e238dc0bc83cc4946033f7 (patch) | |
tree | 28199d1f332789cd03cd3f205069ffa190aa5b8e /src | |
parent | 071e47db9a38ff1fbcef14ebecd8a54fb825f6e5 (diff) | |
download | openbsd-f1380ec05ac6100b94e238dc0bc83cc4946033f7.tar.gz openbsd-f1380ec05ac6100b94e238dc0bc83cc4946033f7.tar.bz2 openbsd-f1380ec05ac6100b94e238dc0bc83cc4946033f7.zip |
Implement imodule_free() and call it from module_finish()
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/conf/conf_mod.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/lib/libcrypto/conf/conf_mod.c b/src/lib/libcrypto/conf/conf_mod.c index f1a88c92b3..f1522b9518 100644 --- a/src/lib/libcrypto/conf/conf_mod.c +++ b/src/lib/libcrypto/conf/conf_mod.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_mod.c,v 1.29 2024/03/20 21:21:03 tb Exp $ */ | 1 | /* $OpenBSD: conf_mod.c,v 1.30 2024/03/20 21:31:31 tb Exp $ */ |
2 | /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2001. | 3 | * project 2001. |
4 | */ | 4 | */ |
@@ -97,6 +97,7 @@ static STACK_OF(CONF_MODULE) *supported_modules = NULL; | |||
97 | static STACK_OF(CONF_IMODULE) *initialized_modules = NULL; | 97 | static STACK_OF(CONF_IMODULE) *initialized_modules = NULL; |
98 | 98 | ||
99 | static void module_free(CONF_MODULE *md); | 99 | static void module_free(CONF_MODULE *md); |
100 | static void imodule_free(CONF_IMODULE *imod); | ||
100 | static void module_finish(CONF_IMODULE *imod); | 101 | static void module_finish(CONF_IMODULE *imod); |
101 | static int module_run(const CONF *cnf, char *name, char *value, | 102 | static int module_run(const CONF *cnf, char *name, char *value, |
102 | unsigned long flags); | 103 | unsigned long flags); |
@@ -371,6 +372,17 @@ module_free(CONF_MODULE *md) | |||
371 | free(md); | 372 | free(md); |
372 | } | 373 | } |
373 | 374 | ||
375 | static void | ||
376 | imodule_free(CONF_IMODULE *imod) | ||
377 | { | ||
378 | if (imod == NULL) | ||
379 | return; | ||
380 | |||
381 | free(imod->name); | ||
382 | free(imod->value); | ||
383 | free(imod); | ||
384 | } | ||
385 | |||
374 | /* finish and free up all modules instances */ | 386 | /* finish and free up all modules instances */ |
375 | 387 | ||
376 | void | 388 | void |
@@ -394,9 +406,8 @@ module_finish(CONF_IMODULE *imod) | |||
394 | if (imod->pmod->finish) | 406 | if (imod->pmod->finish) |
395 | imod->pmod->finish(imod); | 407 | imod->pmod->finish(imod); |
396 | imod->pmod->links--; | 408 | imod->pmod->links--; |
397 | free(imod->name); | 409 | |
398 | free(imod->value); | 410 | imodule_free(imod); |
399 | free(imod); | ||
400 | } | 411 | } |
401 | 412 | ||
402 | /* Add a static module to OpenSSL */ | 413 | /* Add a static module to OpenSSL */ |