Skip to content
Snippets Groups Projects
Commit b6a080d6 authored by Richard Mudgett's avatar Richard Mudgett
Browse files

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent a1815442
No related branches found
No related tags found
No related merge requests found
......@@ -177,10 +177,11 @@ void *ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size),
pthread_once(&ts->once, ts->key_init);
if (!(buf = pthread_getspecific(ts->key))) {
if (!(buf = ast_calloc(1, init_size)))
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 @@ void *__ast_threadstorage_get(struct ast_threadstorage *ts, size_t init_size, co
pthread_once(&ts->once, ts->key_init);
if (!(buf = pthread_getspecific(ts->key))) {
if (!(buf = ast_calloc(1, init_size)))
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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment