[asterisk-commits] mmichelson: branch group/rls r418110 - /team/group/rls/res/res_pjsip_pubsub.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jul 7 09:12:10 CDT 2014
Author: mmichelson
Date: Mon Jul 7 09:12:04 2014
New Revision: 418110
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418110
Log:
Add NULL checks when allocating resource tree nodes.
Modified:
team/group/rls/res/res_pjsip_pubsub.c
Modified: team/group/rls/res/res_pjsip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/team/group/rls/res/res_pjsip_pubsub.c?view=diff&rev=418110&r1=418109&r2=418110
==============================================================================
--- team/group/rls/res/res_pjsip_pubsub.c (original)
+++ team/group/rls/res/res_pjsip_pubsub.c Mon Jul 7 09:12:04 2014
@@ -787,17 +787,26 @@
if (!child_list) {
int resp = handler->notifier->new_subscribe(endpoint, resource);
if (PJSIP_IS_STATUS_IN_CLASS(resp, 200)) {
+ current = tree_node_alloc(resource, visited);
+ if (!current) {
+ ast_debug(1, "Subscription to leaf resource %s was successful, but encountered"
+ "allocation error afterwards\n", resource);
+ continue;
+ }
ast_debug(1, "Subscription to leaf resource %s resulted in success. Adding to parent %s\n",
resource, parent->resource);
- current = tree_node_alloc(resource, visited);
AST_VECTOR_APPEND(&parent->children, current);
} else {
ast_debug(1, "Subscription to leaf resource %s resulted in error response %d\n",
resource, resp);
}
} else {
- ast_debug(1, "Resource %s is a list\n", resource);
+ ast_debug(1, "Resource %s (child of %s) is a list\n", resource, parent->resource);
current = tree_node_alloc(resource, visited);
+ if (!current) {
+ ast_debug(1, "Cannot build children of resource %s due to allocation failure\n", resource);
+ continue;
+ }
build_node_children(endpoint, handler, child_list, current, visited);
if (AST_VECTOR_SIZE(¤t->children) > 0) {
ast_debug(1, "List %s had no successful children.\n", resource);
More information about the asterisk-commits
mailing list