Skip to content
Snippets Groups Projects
Commit 5757d2d3 authored by Corey Farrell's avatar Corey Farrell
Browse files

Check for ao2_alloc failure in __ast_channel_internal_alloc.

Fix a crash that could occur in __ast_channel_internal_alloc if
ao2_alloc fails.

ASTERISK-24991 #close

Change-Id: I4ca89189eb22f907408cb87d0a1645cfe1314a90
parent 614f5066
No related branches found
No related tags found
No related merge requests found
......@@ -1449,6 +1449,10 @@ struct ast_channel *__ast_channel_internal_alloc(void (*destructor)(void *obj),
tmp = ao2_alloc(sizeof(*tmp), destructor);
#endif
if (!tmp) {
return NULL;
}
if ((ast_string_field_init(tmp, 128))) {
return ast_channel_unref(tmp);
}
......
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