Uploaded image for project: 'Axis-C++'
  1. Axis-C++
  2. AXISCPP-919

Double delete in generated DestroyInstance()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • current (nightly)
    • current (nightly)
    • None
    • None

    Description

      The generated code for each web service has this function:

      STORAGE_CLASS_INFO
      int DestroyInstance(BasicHandler *inst)
      {
      if (inst)

      { WrapperClassHandler* pWCH = reinterpret_cast<WrapperClassHandler*>(inst); pWCH->fini(); delete pWCH; delete inst; return AXIS_SUCCESS; }

      return AXIS_FAIL;
      }

      The same pointer (inst and pWCH) is deleted twice. If inst is really of type WrapperClassHandler*, as suggested by the reinterpret_cast<>, then the
      delete inst;
      call should be removed.

      Attachments

        1. diff.txt
          0.8 kB
          Henrik Nordberg

        Activity

          People

            dicka Adrian Dick
            hnordberg Henrik Nordberg
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: