[asterisk-commits] mmichelson: branch mmichelson/ao2_containers r140602 - /team/mmichelson/ao2_c...
    SVN commits to the Asterisk project 
    asterisk-commits at lists.digium.com
       
    Tue Sep  2 11:27:04 CDT 2008
    
    
  
Author: mmichelson
Date: Tue Sep  2 11:27:04 2008
New Revision: 140602
URL: http://svn.digium.com/view/asterisk?view=rev&rev=140602
Log:
Fix a couple of memory leaks and make the 
random_level function static
Modified:
    team/mmichelson/ao2_containers/main/astobj2_hashtable.c
    team/mmichelson/ao2_containers/main/astobj2_skiplist.c
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=140602&r1=140601&r2=140602
==============================================================================
--- team/mmichelson/ao2_containers/main/astobj2_hashtable.c (original)
+++ team/mmichelson/ao2_containers/main/astobj2_hashtable.c Tue Sep  2 11:27:04 2008
@@ -242,4 +242,7 @@
 			ast_free(current);
 		}
 	}
-}
+
+	ast_free(hashtable_pvt);
+
+}
Modified: team/mmichelson/ao2_containers/main/astobj2_skiplist.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/ao2_containers/main/astobj2_skiplist.c?view=diff&rev=140602&r1=140601&r2=140602
==============================================================================
--- team/mmichelson/ao2_containers/main/astobj2_skiplist.c (original)
+++ team/mmichelson/ao2_containers/main/astobj2_skiplist.c Tue Sep  2 11:27:04 2008
@@ -78,7 +78,7 @@
 	return c;
 }
 
-int random_level(int max)
+static int random_level(int max)
 {
 	int level = 1;
 	while (!(ast_random() & 3) && level++ <= max);
@@ -200,4 +200,6 @@
 	while ((iter = AST_LIST_REMOVE_HEAD(skip_pvt->skiplist, entry[0]))) {
 		ast_free(iter);
 	}
-}
+
+	ast_free(skip_pvt);
+}
    
    
More information about the asterisk-commits
mailing list