mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Merged revisions 90348 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r90348 | russell | 2007-11-30 13:26:04 -0600 (Fri, 30 Nov 2007) | 8 lines Change the behavior of ao2_link(). Previously, in inherited a reference. Now, it automatically increases the reference count to reflect the reference that is now held by the container. This was done to be more consistent with ao2_unlink(), which automatically releases the reference held by the container. It also makes it so it is no longer possible for a pointer to be invalid after ao2_link() returns. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3087,8 +3087,6 @@ static void xml_translate(struct ast_str **out, char *in, struct ast_variable *v
|
||||
vc = ao2_alloc(sizeof(*vc), NULL);
|
||||
vc->varname = var;
|
||||
vc->count = 1;
|
||||
/* Increment refcount, because we're going to deref once later */
|
||||
ao2_ref(vc, 1);
|
||||
ao2_link(vco, vc);
|
||||
}
|
||||
xml_copy_escape(out, var, xml ? 1 | 2 : 0);
|
||||
|
Reference in New Issue
Block a user