diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-12-20 03:12:32 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-12-20 03:26:47 +0000 |
| commit | c01d03a6587b18722e5a7381084591e01eca64b5 (patch) | |
| tree | 2a55fb6589e8cbd63e266855d627d93731a62b48 /lib/command.c | |
| parent | 96133092e02c7b07c9e4c6d3e26b871551fa0cef (diff) | |
bgpd, lib: fix a few scan-build catches
Fixes a couple null pointer derefs and uninit'd values.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command.c')
| -rw-r--r-- | lib/command.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c index ca0d0c001b..3cce4584e9 100644 --- a/lib/command.c +++ b/lib/command.c @@ -304,6 +304,9 @@ cmd_concat_strvec (vector v) if (vector_slot (v, i)) strsize += strlen ((char *) vector_slot (v, i)) + 1; + if (strsize == 0) + return XSTRDUP (MTYPE_TMP, ""); + char *concatenated = calloc (sizeof (char), strsize); for (unsigned int i = 0; i < vector_active (v); i++) { |
