]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6775 #resolve
authorBrian West <brian@freeswitch.org>
Fri, 29 Aug 2014 14:55:00 +0000 (09:55 -0500)
committerBrian West <brian@freeswitch.org>
Fri, 29 Aug 2014 14:55:00 +0000 (09:55 -0500)
src/mod/applications/mod_hash/mod_hash.c

index b24cab6bc7bad26f73c203a5cde59ff04ced5dda..a90a3fe4d8c3ea86a30ad1336e257815dab3444f 100644 (file)
@@ -279,7 +279,7 @@ SWITCH_LIMIT_RELEASE(limit_release_hash)
        switch_channel_t *channel = switch_core_session_get_channel(session);
        limit_hash_private_t *pvt = switch_channel_get_private(channel, "limit_hash");
        limit_hash_item_t *item = NULL;
-       switch_hash_index_t *hi;
+       switch_hash_index_t *hi = NULL;
        char *hashkey = NULL;
 
        if (!pvt || !pvt->hash) {
@@ -291,7 +291,7 @@ SWITCH_LIMIT_RELEASE(limit_release_hash)
        /* clear for uuid */
        if (realm == NULL && resource == NULL) {
                /* Loop through the channel's hashtable which contains mapping to all the limit_hash_item_t referenced by that channel */
-               while ((hi = switch_core_hash_first(pvt->hash))) {
+               while ((hi = switch_core_hash_first_iter(pvt->hash, hi))) {
                        void *val = NULL;
                        const void *key;
                        switch_ssize_t keylen;
@@ -311,6 +311,7 @@ SWITCH_LIMIT_RELEASE(limit_release_hash)
 
                        switch_core_hash_delete(pvt->hash, (const char *) key);
                }
+               switch_core_hash_destroy(&pvt->hash);
        } else {
                hashkey = switch_core_session_sprintf(session, "%s_%s", realm, resource);