Merge "Check for ao2_alloc failure in __ast_channel_internal_alloc."

changes/93/193/1
Joshua Colp 10 years ago committed by Gerrit Code Review
commit 84a30a4ad3

@ -1449,6 +1449,10 @@ struct ast_channel *__ast_channel_internal_alloc(void (*destructor)(void *obj),
tmp = ao2_alloc(sizeof(*tmp), destructor); tmp = ao2_alloc(sizeof(*tmp), destructor);
#endif #endif
if (!tmp) {
return NULL;
}
if ((ast_string_field_init(tmp, 128))) { if ((ast_string_field_init(tmp, 128))) {
return ast_channel_unref(tmp); return ast_channel_unref(tmp);
} }

Loading…
Cancel
Save