conversion from malloc to ast_malloc

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@16006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant 2006-03-29 04:09:31 +00:00
parent 705ccb2218
commit 6601f4deba
2 changed files with 5 additions and 6 deletions

View File

@ -103,11 +103,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
/* Define SCHED_MULTITHREADED to run the scheduler in a special /* Define SCHED_MULTITHREADED to run the scheduler in a special
multithreaded mode. */ multithreaded mode. */
#define SCHED_MULTITHREADED // #define SCHED_MULTITHREADED
/* Define DEBUG_SCHED_MULTITHREADED to keep track of where each /* Define DEBUG_SCHED_MULTITHREADED to keep track of where each
thread is actually doing. */ thread is actually doing. */
#define DEBUG_SCHED_MULTITHREAD // #define DEBUG_SCHED_MULTITHREAD
#ifdef NEWJB #ifdef NEWJB
#include "../jitterbuf.h" #include "../jitterbuf.h"

View File

@ -110,7 +110,7 @@ struct ast_trans_pvt *ast_translator_build_path(int dest, int source)
source = powerof(source); source = powerof(source);
dest = powerof(dest); dest = powerof(dest);
while(source != dest) { while (source != dest) {
if (!tr_matrix[source][dest].step) { if (!tr_matrix[source][dest].step) {
/* We shouldn't have allocated any memory */ /* We shouldn't have allocated any memory */
ast_log(LOG_WARNING, "No translator path from %s to %s\n", ast_log(LOG_WARNING, "No translator path from %s to %s\n",
@ -119,13 +119,12 @@ struct ast_trans_pvt *ast_translator_build_path(int dest, int source)
} }
if (tmp) { if (tmp) {
tmp->next = malloc(sizeof(*tmp)); tmp->next = ast_malloc(sizeof(*tmp));
tmp = tmp->next; tmp = tmp->next;
} else } else
tmp = malloc(sizeof(*tmp)); tmp = ast_malloc(sizeof(*tmp));
if (!tmp) { if (!tmp) {
ast_log(LOG_WARNING, "Out of memory\n");
if (tmpr) if (tmpr)
ast_translator_free_path(tmpr); ast_translator_free_path(tmpr);
return NULL; return NULL;