diff options
author | Vladimir Kobal <vlad@prokk.net> | 2019-04-17 20:09:59 +0300 |
---|---|---|
committer | Chris Akritidis <43294513+cakrit@users.noreply.github.com> | 2019-04-17 20:09:59 +0300 |
commit | 4683084235b4a633f3182b6ad2f1625b8b5f041c (patch) | |
tree | 2910f324b866f464351840b824d1831fd9ca0b5b /streaming | |
parent | fa5c84a61874b14a3d1a7a6dd9de424a55105f23 (diff) |
Fix segmentation fault in streaming (#5882)
Diffstat (limited to 'streaming')
-rw-r--r-- | streaming/rrdpush.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/streaming/rrdpush.c b/streaming/rrdpush.c index b98d0b3dc6..acf69ffd33 100644 --- a/streaming/rrdpush.c +++ b/streaming/rrdpush.c @@ -151,13 +151,15 @@ static inline void rrdpush_send_chart_definition_nolock(RRDSET *st) { // properly set the name for the remote end to parse it char *name = ""; - if(unlikely(strcmp(st->id, st->name))) { - // they differ - name = strchr(st->name, '.'); - if(name) - name++; - else - name = ""; + if(likely(st->name)) { + if(unlikely(strcmp(st->id, st->name))) { + // they differ + name = strchr(st->name, '.'); + if(name) + name++; + else + name = ""; + } } // info("CHART '%s' '%s'", st->id, name); |