FS-9401: [core,mod_amqp] fix leak in usage of hash itterator

This commit is contained in:
Michael Jerris committed 2016-08-03 18:41:18 -05:00
1 parent eebc2d9148
commit 9030e13589
3 files changed
+7 -3

No files matched your search

+3 -1
View File
@@ -1039,7 +1039,7 @@ SWITCH_DECLARE(uint32_t) switch_jb_pop_nack(switch_jb_t *jb)
top:
for (hi = switch_core_hash_first(jb->missing_seq_hash); hi; hi = switch_core_hash_next(&hi)) {
for (hi = switch_core_hash_first_iter(jb->missing_seq_hash, hi); hi; hi = switch_core_hash_next(&hi)) {
uint16_t seq;
//const char *token;
switch_time_t then = 0;
@@ -1076,6 +1076,8 @@ SWITCH_DECLARE(uint32_t) switch_jb_pop_nack(switch_jb_t *jb)
}
}
switch_safe_free(hi);
if (least && switch_core_inthash_delete(jb->missing_seq_hash, (uint32_t)htons(least))) {
jb_debug(jb, 3, "Found NACKABLE seq %u\n", least);
nack = (uint32_t) htons(least);