Browse Source

Merge pull request #2698 from richardkchapman/valgrind

Fix some issues detected by Valgrind

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 13 years ago
parent
commit
b2e113eba5
4 changed files with 7 additions and 5 deletions
  1. 1 1
      common/fileview2/fvidxsource.cpp
  2. 1 1
      ecl/hthor/hthorkey.cpp
  3. 1 1
      roxie/ccd/ccdfile.cpp
  4. 4 2
      roxie/ccd/ccdserver.cpp

+ 1 - 1
common/fileview2/fvidxsource.cpp

@@ -42,7 +42,7 @@ static IKeyIndex *openKeyFile(IDistributedFilePart *keyFile)
             {
                 StringBuffer remotePath;
                 rfn.getRemotePath(remotePath);
-                unsigned crc;
+                unsigned crc = 0;
                 keyFile->getCrc(crc);
                 return createKeyIndex(remotePath.str(), crc, false, false);
             }

+ 1 - 1
ecl/hthor/hthorkey.cpp

@@ -51,7 +51,7 @@ static IKeyIndex *openKeyFile(IDistributedFilePart & keyFile)
             {
                 StringBuffer remotePath;
                 rfn.getRemotePath(remotePath);
-                unsigned crc;
+                unsigned crc = 0;
                 keyFile.getCrc(crc);
                 return createKeyIndex(remotePath.str(), crc, false, false);
             }

+ 1 - 1
roxie/ccd/ccdfile.cpp

@@ -2141,7 +2141,7 @@ public:
                     assertex(numParts > 0);
                     IPartDescriptor *pdesc = fdesc->queryPart(numParts - 1);
                     Owned<ILazyFileIO> keyFile = createDynamicFile(subNames.item(idx), pdesc, ROXIE_KEY, numParts);
-                    unsigned crc;
+                    unsigned crc = 0;
                     pdesc->getCrc(crc);
                     StringBuffer pname;
                     pdesc->getPath(pname);

+ 4 - 2
roxie/ccd/ccdserver.cpp

@@ -29468,9 +29468,11 @@ public:
             loop
             {
                 char c0 = *val++;
-                char c1 = *val++;
-                if (!c0 || !c1)
+                if (!c0)
                     break;
+                char c1 = *val++;
+                if (!c1)
+                    break; // Shouldn't really happen - we expect even length
                 unsigned c2 = (hex2digit(c0) << 4) | hex2digit(c1);
                 result.append((unsigned char) c2);
             }