[asterisk-commits] rmudgett: trunk r397857 - in /trunk: ./ include/asterisk/threadstorage.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 28 11:07:35 CDT 2013


Author: rmudgett
Date: Wed Aug 28 11:07:30 2013
New Revision: 397857

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397857
Log:
Match use of ast_free() with ast_calloc() and add some curly braces.
........

Merged revisions 397856 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/include/asterisk/threadstorage.h

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Wed Aug 28 11:07:30 2013
@@ -1,1 +1,1 @@
-/branches/12:1-397816,397854
+/branches/12:1-397816,397854,397856

Modified: trunk/include/asterisk/threadstorage.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/threadstorage.h?view=diff&rev=397857&r1=397856&r2=397857
==============================================================================
--- trunk/include/asterisk/threadstorage.h (original)
+++ trunk/include/asterisk/threadstorage.h Wed Aug 28 11:07:30 2013
@@ -177,10 +177,11 @@
 
 	pthread_once(&ts->once, ts->key_init);
 	if (!(buf = pthread_getspecific(ts->key))) {
-		if (!(buf = ast_calloc(1, init_size)))
-			return NULL;
+		if (!(buf = ast_calloc(1, init_size))) {
+			return NULL;
+		}
 		if (ts->custom_init && ts->custom_init(buf)) {
-			free(buf);
+			ast_free(buf);
 			return NULL;
 		}
 		pthread_setspecific(ts->key, buf);
@@ -197,10 +198,11 @@
 
 	pthread_once(&ts->once, ts->key_init);
 	if (!(buf = pthread_getspecific(ts->key))) {
-		if (!(buf = ast_calloc(1, init_size)))
-			return NULL;
+		if (!(buf = ast_calloc(1, init_size))) {
+			return NULL;
+		}
 		if (ts->custom_init && ts->custom_init(buf)) {
-			free(buf);
+			ast_free(buf);
 			return NULL;
 		}
 		pthread_setspecific(ts->key, buf);




More information about the asterisk-commits mailing list