• Icon: Technical task Technical task
    • Resolution: Won't Do
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • Static analysis

      Coverity complains about the following code sequence:

      QDialog dlg(this); // also without parent
      if (dlg.exec()) { // warning: Free of address of expression (BAD_FREE)
         ...
      }
      

      because QDialog::exec() might call

          bool deleteOnClose = testAttribute(Qt::WA_DeleteOnClose);
          // ...
          if (deleteOnClose)
              delete this;
      

      WA_DeleteOnClose is never set in the cases that Coverity warns about. It can be, in which case it would be a programming error that Coverity should warn about.

      It might be possible to provide a modeling file to train Coverity that this code patternis not problematic. Failing that, we might need to find another way to dismiss those warnings.

      Coverity ID 265281 and more.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            levon.sargsyan Levon Sargsyan (Inactive)
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes