ao2_iterator: Mini-audit of the ao2_iterator loops in the new code files.
[asterisk/asterisk.git] / res / res_pjsip / location.c
index ddd8461..52f69cf 100644 (file)
@@ -304,6 +304,7 @@ int ast_sip_for_each_contact(const struct ast_sip_aor *aor,
 
                ao2_ref(contact, -1);
                if (res) {
+                       ao2_iterator_destroy(&i);
                        return -1;
                }
        }