Browse Source

Fix coverity issues (#13168)

Stelios Fragkakis 2 years ago
parent
commit
370a890973

+ 1 - 1
collectors/diskspace.plugin/plugin_diskspace.c

@@ -9,7 +9,7 @@
 #define DEFAULT_EXCLUDED_FILESYSTEMS "*gvfs *gluster* *s3fs *ipfs *davfs2 *httpfs *sshfs *gdfs *moosefs fusectl autofs"
 #define CONFIG_SECTION_DISKSPACE "plugin:proc:diskspace"
 
-#define MAX_STAT_USEC 10000
+#define MAX_STAT_USEC 10000LU
 #define SLOW_UPDATE_EVERY 5
 
 static netdata_thread_t *diskspace_slow_thread = NULL;

+ 1 - 1
collectors/statsd.plugin/statsd.c

@@ -593,7 +593,6 @@ static inline void statsd_process_set(STATSD_METRIC *m, const char *value) {
     if(unlikely(m->reset)) {
         if(likely(m->set.dict)) {
             dictionary_destroy(m->set.dict);
-            dictionary_register_insert_callback(m->set.dict, dictionary_metric_set_value_insert_callback, m);
             m->set.dict = NULL;
         }
         statsd_reset_metric(m);
@@ -601,6 +600,7 @@ static inline void statsd_process_set(STATSD_METRIC *m, const char *value) {
 
     if (unlikely(!m->set.dict)) {
         m->set.dict   = dictionary_create(STATSD_DICTIONARY_OPTIONS);
+        dictionary_register_insert_callback(m->set.dict, dictionary_metric_set_value_insert_callback, m);
         m->set.unique = 0;
     }