stasis: Fix leaks

* Release reference returned by cache_remove
* state_alloc unconditionally bumped state_topic even when it was
  locally allocated.

Change-Id: I51101bf7d07b8dc8ce8fc46b6cb31fbbd213fbc7
This commit is contained in:
Corey Farrell
2019-09-19 18:32:56 -04:00
parent e79a3b428a
commit 3dfbc05c53
2 changed files with 8 additions and 8 deletions

View File

@@ -868,7 +868,7 @@ static void caching_topic_exec(void *data, struct stasis_subscription *sub,
ao2_wrlock(caching_topic->cache->entries);
sub = cache_find(caching_topic->cache->entries, stasis_subscription_change_type(), change->uniqueid);
if (sub) {
cache_remove(caching_topic->cache->entries, sub, stasis_message_eid(message));
ao2_cleanup(cache_remove(caching_topic->cache->entries, sub, stasis_message_eid(message)));
ao2_cleanup(sub);
}
ao2_unlock(caching_topic->cache->entries);