summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-04-17 17:59:47 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-04-18 12:16:19 -0400
commit68a63f60ae495823cc9cc6f4fe6caaaec2f1b670 (patch)
tree95ac39d26dc3106d0c056088c2718e4d2a3875de
parentd64169679f4efccd5be63d4ca5c73b6bc41187d6 (diff)
pbrd: remove potential null dereference
Coverity #1467832 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--pbrd/pbr_nht.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c
index 1ce8c2104d..4a420c3e84 100644
--- a/pbrd/pbr_nht.c
+++ b/pbrd/pbr_nht.c
@@ -209,6 +209,13 @@ void pbr_nhgroup_add_cb(const char *name)
struct nexthop_group_cmd *nhgc;
nhgc = nhgc_find(name);
+
+ if (!nhgc) {
+ DEBUGD(&pbr_dbg_nht, "%s: Could not find nhgc with name: %s\n",
+ __PRETTY_FUNCTION__, name);
+ return;
+ }
+
pnhgc = pbr_nht_add_group(name);
DEBUGD(&pbr_dbg_nht, "%s: Added nexthop-group %s", __PRETTY_FUNCTION__,