Merge "Check for ao2_alloc failure in __ast_channel_internal_alloc." into 13

This commit is contained in:
Joshua Colp
2015-04-22 05:45:20 -05:00
committed by Gerrit Code Review

View File

@@ -1457,6 +1457,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);
}