[Asterisk-code-review] res_sorcery_memory_cache: stale item update leak (...asterisk[16])

Kevin Harwell asteriskteam at digium.com
Mon Sep 23 11:05:04 CDT 2019


Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/12918


Change subject: res_sorcery_memory_cache: stale item update leak
......................................................................

res_sorcery_memory_cache: stale item update leak

When a stale item was being updated the object was being retrieved, but its
reference was not being decremented after the update. This patch makes it so
the object is now appropriately de-referenced.

ASTERISK-28523

Change-Id: I9d8173d3a0416a242f4eba92fa0853279c500ec7
---
M res/res_sorcery_memory_cache.c
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/18/12918/1

diff --git a/res/res_sorcery_memory_cache.c b/res/res_sorcery_memory_cache.c
index 42da727..5029131 100644
--- a/res/res_sorcery_memory_cache.c
+++ b/res/res_sorcery_memory_cache.c
@@ -1006,6 +1006,7 @@
 			ast_sorcery_object_get_id(task_data->object));
 		sorcery_memory_cache_create(task_data->sorcery, task_data->cache,
 			object);
+		ao2_ref(object, -1);
 	}
 
 	ast_test_suite_event_notify("SORCERY_MEMORY_CACHE_REFRESHED", "Cache: %s\r\nType: %s\r\nName: %s\r\n",

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12918
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I9d8173d3a0416a242f4eba92fa0853279c500ec7
Gerrit-Change-Number: 12918
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190923/e76b09dd/attachment.html>


More information about the asterisk-code-review mailing list