From 6b90f5d00cab07ca36b107b21cde31ec974aca27 Mon Sep 17 00:00:00 2001 From: Giovanni Giacobbi Date: Tue, 2 Apr 2002 12:08:37 +0000 Subject: [PATCH] Fixed a negative refcount situation for the config context --- CHANGES | 3 +++ apps/silcd/serverconfig.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index d26adae2..25f97981 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,9 @@ Tue Apr 2 13:39:04 CEST 2002 Johnny Mnemonic * Merged version 1.1.4 of zlib. Even if it not currently in use, it's good not to have security holes here. + * Fixed a negative refcount situtuation for the config context. + Affected file is silcd/serverconfig.c. + Mon Apr 1 20:15:10 CEST 2002 Johnny Mnemonic * ROBOdoc documented lib/silcutil/silcutil.h. diff --git a/apps/silcd/serverconfig.c b/apps/silcd/serverconfig.c index 568e19f8..b5dbc04c 100644 --- a/apps/silcd/serverconfig.c +++ b/apps/silcd/serverconfig.c @@ -1201,6 +1201,7 @@ SilcServerConfig silc_server_config_alloc(const char *filename) /* alloc a config object */ config_new = silc_calloc(1, sizeof(*config_new)); + config_new->refcount = 1; if (!config_new) return NULL; @@ -1257,7 +1258,6 @@ SilcServerConfig silc_server_config_alloc(const char *filename) /* Set default to configuration parameters */ silc_server_config_set_defaults(config_new); - config_new->refcount = 1; return config_new; } @@ -1270,7 +1270,7 @@ void silc_server_config_ref(SilcServerConfigRef *ref, SilcServerConfig config, config->refcount++; ref->config = config; ref->ref_ptr = ref_ptr; - SILC_LOG_DEBUG(("Referencing config [%p] refcnt %hu->%hu", config, + SILC_LOG_DEBUG(("Referencing config [%p] refcnt %d->%d", config, config->refcount - 1, config->refcount)); } } @@ -1291,7 +1291,7 @@ void silc_server_config_destroy(SilcServerConfig config) void *tmp; config->refcount--; - SILC_LOG_DEBUG(("Unreferencing config [%p] refcnt %hu->%hu", config, + SILC_LOG_DEBUG(("Unreferencing config [%p] refcnt %d->%d", config, config->refcount + 1, config->refcount)); if (config->refcount > 0) return; -- 2.24.0