diff --git a/libs/freetdm/src/zap_io.c b/libs/freetdm/src/zap_io.c index 52211d8fb1..c92083f914 100644 --- a/libs/freetdm/src/zap_io.c +++ b/libs/freetdm/src/zap_io.c @@ -2102,6 +2102,8 @@ zap_status_t zap_global_init(void) { int modcount; + memset(&globals, 0, sizeof(globals)); + time_init(); zap_isdn_init(); zap_ss7_boost_init(); @@ -2224,6 +2226,8 @@ zap_status_t zap_global_destroy(void) hashtable_destroy(globals.interface_hash, 0, 0); zap_mutex_unlock(globals.mutex); zap_mutex_destroy(&globals.mutex); + + memset(&globals, 0, sizeof(globals)); return ZAP_SUCCESS; } diff --git a/libs/freetdm/src/zap_pika.c b/libs/freetdm/src/zap_pika.c index 310cf5b1c1..ffe79e397c 100644 --- a/libs/freetdm/src/zap_pika.c +++ b/libs/freetdm/src/zap_pika.c @@ -1330,6 +1330,8 @@ zap_status_t pika_destroy(void) if ((status = PKH_SYSTEM_Close(globals.system_handle)) != PK_SUCCESS) { zap_log(ZAP_LOG_ERROR, "Error: PKH_SYSTEM_Close failed(%s)!\n", PKH_ERROR_GetText(status, error_text, sizeof(error_text))); + } else { + zap_log(ZAP_LOG_INFO, "Closing system handle\n"); } hashtable_destroy(globals.profile_hash, 0, 1);