]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/qobj.c
lib: make qobj NULL-safe/aware
[mirror_frr.git] / lib / qobj.c
index f64972e32aa3569ec6795cd96af6338d2019ba06..aeae52e0297467dfd456e2561f091fdcddbe9ad3 100644 (file)
@@ -49,7 +49,7 @@ void qobj_reg(struct qobj_node *node, struct qobj_nodetype *type)
       node->nid  = (uint64_t)random();
       node->nid ^= (uint64_t)random() << 32;
     }
-  while (hash_get (nodes, node, hash_alloc_intern) != node);
+  while (!node->nid || hash_get (nodes, node, hash_alloc_intern) != node);
 }
 
 void qobj_unreg(struct qobj_node *node)