qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject svn commit: r1682227 - /qpid/dispatch/trunk/src/router_node.c
Date Thu, 28 May 2015 12:28:17 GMT
Author: tross
Date: Thu May 28 12:28:17 2015
New Revision: 1682227

URL: http://svn.apache.org/r1682227
Log:
NO-JIRA - Added missing null-pointer checks.

Modified:
    qpid/dispatch/trunk/src/router_node.c

Modified: qpid/dispatch/trunk/src/router_node.c
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/router_node.c?rev=1682227&r1=1682226&r2=1682227&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/router_node.c (original)
+++ qpid/dispatch/trunk/src/router_node.c Thu May 28 12:28:17 2015
@@ -434,7 +434,7 @@ void qd_router_link_free_LH(qd_router_li
 static int router_writable_link_handler(void* context, qd_link_t *link)
 {
     qd_router_t            *router = (qd_router_t*) context;
-    qd_router_delivery_t          *delivery;
+    qd_router_delivery_t   *delivery;
     qd_router_link_t       *rlink = (qd_router_link_t*) qd_link_get_context(link);
     pn_link_t              *pn_link = qd_link_pn(link);
     uint64_t                tag;
@@ -447,6 +447,9 @@ static int router_writable_link_handler(
     bool                    drain_mode;
     bool                    drain_changed = qd_link_drain_changed(link, &drain_mode);
 
+    if (!rlink)
+        return 0;
+
     DEQ_INIT(to_send);
     DEQ_INIT(events);
 
@@ -744,6 +747,11 @@ static void router_rx_handler(void* cont
     //
     pn_link_advance(pn_link);
 
+    if (!rlink) {
+        qd_message_free(msg);
+        return;
+    }
+
     //
     // Handle the Link-Routing case.
     //
@@ -1458,6 +1466,9 @@ static int router_link_attach_handler(vo
     qd_router_t      *router = (qd_router_t*) context;
     qd_router_link_t *rlink  = (qd_router_link_t*) qd_link_get_context(link);
 
+    if (!rlink)
+        return 0;
+
     sys_mutex_lock(router->lock);
     qd_router_link_t *peer_rlink = rlink->connected_link;
     if (peer_rlink) {
@@ -1485,6 +1496,9 @@ static int router_link_flow_handler(void
     qd_router_link_t *rlink      = (qd_router_link_t*) qd_link_get_context(link);
     pn_link_t        *pn_link    = qd_link_pn(link);
 
+    if (!rlink)
+        return 0;
+
     sys_mutex_lock(router->lock);
     qd_router_link_t *peer_rlink = rlink->connected_link;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message