[asterisk-commits] rmudgett: branch 12 r397856 - /branches/12/include/asterisk/threadstorage.h

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


Author: rmudgett
Date: Wed Aug 28 11:07:00 2013
New Revision: 397856

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

Modified:
    branches/12/include/asterisk/threadstorage.h

Modified: branches/12/include/asterisk/threadstorage.h
URL: http://svnview.digium.com/svn/asterisk/branches/12/include/asterisk/threadstorage.h?view=diff&rev=397856&r1=397855&r2=397856
==============================================================================
--- branches/12/include/asterisk/threadstorage.h (original)
+++ branches/12/include/asterisk/threadstorage.h Wed Aug 28 11:07:00 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