mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
ast_calloc() already reports OOM conditions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@34241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -256,7 +256,6 @@ static int load_odbc_config(void)
|
|||||||
new = ast_calloc(1, sizeof(*new));
|
new = ast_calloc(1, sizeof(*new));
|
||||||
|
|
||||||
if (!new) {
|
if (!new) {
|
||||||
ast_log(LOG_ERROR, "Memory error while loading configuration.\n");
|
|
||||||
res = -1;
|
res = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -397,7 +396,6 @@ struct odbc_obj *odbc_request_obj(const char *name, int check)
|
|||||||
class->count++;
|
class->count++;
|
||||||
obj = ast_calloc(1, sizeof(*obj));
|
obj = ast_calloc(1, sizeof(*obj));
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
AST_LIST_UNLOCK(&class->odbc_obj);
|
AST_LIST_UNLOCK(&class->odbc_obj);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -417,7 +415,6 @@ struct odbc_obj *odbc_request_obj(const char *name, int check)
|
|||||||
/* No entry: build one */
|
/* No entry: build one */
|
||||||
obj = ast_calloc(1, sizeof(*obj));
|
obj = ast_calloc(1, sizeof(*obj));
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
AST_LIST_UNLOCK(&class->odbc_obj);
|
AST_LIST_UNLOCK(&class->odbc_obj);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -589,7 +586,6 @@ static int reload(void *mod)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!new) {
|
if (!new) {
|
||||||
ast_log(LOG_ERROR, "Memory error while loading configuration.\n");
|
|
||||||
res = -1;
|
res = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user