summaryrefslogtreecommitdiffstats
path: root/ldpd/packet.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-06-12 22:39:18 +0200
committerDavid Lamparter <equinox@diac24.net>2019-06-13 13:35:33 +0200
commitbb53f1bc6664c3ae3cac8a74014d708624490e65 (patch)
tree2c0019696e4e12ca90ea367d0cae78115a417c72 /ldpd/packet.c
parentospfd: fix clang-SA warning (diff)
downloadfrr-bb53f1bc6664c3ae3cac8a74014d708624490e65.tar.xz
frr-bb53f1bc6664c3ae3cac8a74014d708624490e65.zip
ldpd: fix clang-SA warning in packet reading
clang-SA thinks we can skip the SA but have something allocated in buf. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'ldpd/packet.c')
-rw-r--r--ldpd/packet.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ldpd/packet.c b/ldpd/packet.c
index 8ca90841d..dfab30eeb 100644
--- a/ldpd/packet.c
+++ b/ldpd/packet.c
@@ -618,12 +618,17 @@ session_read(struct thread *thread)
len -= msg_size;
}
free(buf);
+ buf = NULL;
if (len != 0) {
session_shutdown(nbr, S_BAD_PDU_LEN, 0, 0);
return (0);
}
}
+ /* shouldn't happen, session_get_pdu should be > 0 if buf was
+ * allocated - but let's get rid of the SA warning.
+ */
+ free(buf);
return (0);
}