[svn-commits] mmichelson: branch mmichelson/ao2_containers r140401 - /team/mmichelson/ao2_c...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 28 15:07:47 CDT 2008


Author: mmichelson
Date: Thu Aug 28 15:07:46 2008
New Revision: 140401

URL: http://svn.digium.com/view/asterisk?view=rev&rev=140401
Log:
Fixed a bug in hashtable_iterator_next. It was
always returning NULL.

Now when I start Asterisk I get terrible, thunderous,
earth-shaking errors. Okay, it's a double free happening
somewhere, but I still need to track it down.


Modified:
    team/mmichelson/ao2_containers/main/astobj2.c
    team/mmichelson/ao2_containers/main/astobj2_hashtable.c

Modified: team/mmichelson/ao2_containers/main/astobj2.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/ao2_containers/main/astobj2.c?view=diff&rev=140401&r1=140400&r2=140401
==============================================================================
--- team/mmichelson/ao2_containers/main/astobj2.c (original)
+++ team/mmichelson/ao2_containers/main/astobj2.c Thu Aug 28 15:07:46 2008
@@ -521,8 +521,13 @@
 	struct astobj2 *ret = NULL;
 	void *user_data = NULL;
 
-	if (!(a->flags & F_AO2I_DONTLOCK))
+	if (INTERNAL_OBJ(a->c) == NULL) {
+		return NULL;
+	}
+
+	if (!(a->flags & F_AO2I_DONTLOCK)) {
 		ao2_lock(a->c);
+	}
 
 	ret = a->c->impl->iterator_next(a);
 	

Modified: team/mmichelson/ao2_containers/main/astobj2_hashtable.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/ao2_containers/main/astobj2_hashtable.c?view=diff&rev=140401&r1=140400&r2=140401
==============================================================================
--- team/mmichelson/ao2_containers/main/astobj2_hashtable.c (original)
+++ team/mmichelson/ao2_containers/main/astobj2_hashtable.c Thu Aug 28 15:07:46 2008
@@ -224,6 +224,7 @@
 		a->version = p->version;
 		a->obj = p;
 		a->c_version = a->c->version;
+		ret = p->astobj;
 	}
 
 	return ret;




More information about the svn-commits mailing list