Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-18238

Coverity: resource leak and null dereference

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4.2
    • Component/s: ESDL
    • Labels:
      None

      Description

      Coverity report from 4th September includes the following:

       

      ** CID 1455290:  Resource leaks  (CTOR_DTOR_LEAK)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/tools/esdlcomp/esdlcomp.cpp: 1149 in ESDLcompiler::ESDLcompiler(const char *, bool, const char *, bool, bool, const char *)()
       
       
      ________________________________________________________________________________________________________
      *** CID 1455290:  Resource leaks  (CTOR_DTOR_LEAK)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/tools/esdlcomp/esdlcomp.cpp: 1149 in ESDLcompiler::ESDLcompiler(const char *, bool, const char *, bool, bool, const char *)()
      1143         {
      1144             if (!outDir || !*outDir)
      1145                 outDir = srcDir.str();
      1146
      1147             char* targetBase = getTargetBase(outDir, sourceFile);
      1148
      >>>     CID 1455290:  Resource leaks  (CTOR_DTOR_LEAK)
      >>>     The constructor allocates field "esxdlo" of "ESDLcompiler" but the destructor and whatever functions it calls do not free it.
      1149             esxdlo = es_createFile(targetBase,"xml");
      1150
      1151             free(targetBase);
      1152         }
      1153     }
      1154
       
      ** CID 1455291:  Null pointer dereferences  (REVERSE_INULL)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/tools/esdlcmd/esdl2ecl.cpp: 110 in EsdlIndexedPropertyTrees::loadFile(const char *, const char *, const char *, IProperties *, bool, bool, bool, const char *)()
       
       
      ________________________________________________________________________________________________________
      *** CID 1455291:  Null pointer dereferences  (REVERSE_INULL)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/tools/esdlcmd/esdl2ecl.cpp: 110 in EsdlIndexedPropertyTrees::loadFile(const char *, const char *, const char *, IProperties *, bool, bool, bool, const char *)()
      104                 {
      105                     fileName.append(srcext);
      106                     StringBuffer esxml;
      107                     EsdlCmdHelper::convertECMtoESXDL(fileName.str(), srcfile, esxml, loadincludes && rollUp, true, true, isIncludedESDL, includePath);
      108                     src = createPTreeFromXMLString(esxml, 0);
      109                 }
      >>>     CID 1455291:  Null pointer dereferences  (REVERSE_INULL)
      >>>     Null-checking "srcext" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
      110                 else if (!srcext || !*srcext || stricmp(srcext, XML_FILE_EXTENSION)==0)
      111                 {
      112                     fileName.append(XML_FILE_EXTENSION);
      113                     src = createPTreeFromXMLFile(fileName.str(), false);
      114                 }
      115                 else
       

        Attachments

          Activity

            People

            • Assignee:
              rpastrana Rodrigo Pastrana
              Reporter:
              ghalliday Gavin Halliday
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: