[Asterisk-code-review] res sorcery realtime: Fix leak of sorcery object type. (asterisk[master])

Joshua Colp asteriskteam at digium.com
Tue Jun 30 07:32:23 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: res_sorcery_realtime: Fix leak of sorcery object type.
......................................................................


res_sorcery_realtime: Fix leak of sorcery object type.

This prevents a leak of a sorcery object type when realtime sorcery
objects are retrieved by fields or when multiple objects are retrieved.

The extent of this leak is that sorcery object types would be leaked.
These are allocated whenever an object type is registered with sorcery,
meaning that on module shutdown, these objects would be leaked. This
could be problematic if many reloads were performed, but it is not as
severe as if every sorcery object retrieved from realtime were being
leaked.

ASTERISK-25165 #close
Reported by Corey Farrell

Change-Id: I625c3b50eee4576670b7eeb013c81ad043b4b4f8
---
M res/res_sorcery_realtime.c
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Matt Jordan: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/res/res_sorcery_realtime.c b/res/res_sorcery_realtime.c
index 65eb4b8..b2df298 100644
--- a/res/res_sorcery_realtime.c
+++ b/res/res_sorcery_realtime.c
@@ -142,6 +142,8 @@
 		}
 	}
 
+	ao2_ref(object_type, -1);
+
 	return objectset;
 }
 

-- 
To view, visit https://gerrit.asterisk.org/744
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I625c3b50eee4576670b7eeb013c81ad043b4b4f8
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list