write_mongodb: fix potential NULL dereference
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 2 Jul 2017 17:22:20 +0000 (19:22 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 2 Jul 2017 17:23:16 +0000 (19:23 +0200)
commit2c59754399236dee51c68b0b624242c61f89c4c0
treebdc080dad462f54407a09ba0c31adf4a8d72072a
parent7f9c8e704314392b556c27e4034fd910c25b6377
write_mongodb: fix potential NULL dereference

scan-build: Using '/usr/bin/clang-4.0' for static analysis
make  all-am
make[1]: Entering directory '/home/ruben/src/collectd'
  CC       src/write_mongodb_la-write_mongodb.lo
src/write_mongodb.c:173:41: warning: Null pointer passed as an argument to a 'nonnull' parameter
                 strlen(node->passwd) + strlen(node->host) + 5 +
                                        ^~~~~~~~~~~~~~~~~~
src/write_mongodb.c:199:42: warning: Null pointer passed as an argument to a 'nonnull' parameter
    uri_length = strlen(format_string) + strlen(node->host) + 5 + 1;
                                         ^~~~~~~~~~~~~~~~~~
2 warnings generated.
  CCLD     write_mongodb.la
src/write_mongodb.c