Browse Source

Fix coverity errors CID 359774 and CID 359773 (#9338)

Markos Fountoulakis 4 years ago
parent
commit
1ba9479718
2 changed files with 5 additions and 1 deletions
  1. 3 1
      database/rrdhost.c
  2. 2 0
      database/rrdset.c

+ 3 - 1
database/rrdhost.c

@@ -245,7 +245,9 @@ RRDHOST *rrdhost_create(const char *hostname,
     }
     if (host->rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE) {
 #ifdef ENABLE_DBENGINE
-        uuid_parse(host->machine_guid, host->host_uuid);
+        if (unlikely(-1 == uuid_parse(host->machine_guid, host->host_uuid))) {
+            error("Host machine GUID is not valid.");
+        }
         host->objects_nr = 1;
         host->compaction_id = 0;
         char dbenginepath[FILENAME_MAX + 1];

+ 2 - 0
database/rrdset.c

@@ -1906,6 +1906,8 @@ void rrdset_done(RRDSET *st) {
                             metalog_commit_delete_dimension(rd);
                         } else {
                             /* Do not delete this dimension */
+                            last = rd;
+                            rd = rd->next;
                             continue;
                         }
                     }