diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-01-06 19:36:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-06 19:36:59 -0500 |
| commit | 46c323a66bee2899292885085ec7e7b51be095c3 (patch) | |
| tree | 6f3d20049b091876659150b806d68d392d5d0394 /lib/command.c | |
| parent | 15667da96d34556edbb6050008fe3ae2f0f75f8e (diff) | |
| parent | c01d03a6587b18722e5a7381084591e01eca64b5 (diff) | |
Merge pull request #27 from qlyoung/fix-derefs2
bgpd, lib: fix a few scan-build catches
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 35aac3e6e3..6294e994e7 100644 --- a/lib/command.c +++ b/lib/command.c @@ -299,6 +299,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++) { |
