mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-24 04:37:38 +00:00
gracefully handle allocation failure
This commit is contained in:
parent
2e8572acb5
commit
e98045841e
@ -624,6 +624,12 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
|
|||||||
switch_memory_pool_t *pool = cbt->pool;
|
switch_memory_pool_t *pool = cbt->pool;
|
||||||
|
|
||||||
additional = switch_core_alloc(pool, sizeof(lcr_obj_t));
|
additional = switch_core_alloc(pool, sizeof(lcr_obj_t));
|
||||||
|
|
||||||
|
if (!additional) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error allocating in route_add_callback\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
switch_event_create(&additional->fields, SWITCH_EVENT_REQUEST_PARAMS);
|
switch_event_create(&additional->fields, SWITCH_EVENT_REQUEST_PARAMS);
|
||||||
|
|
||||||
for (i = 0; i < argc ; i++) {
|
for (i = 0; i < argc ; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user