Details

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

    Description

      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.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes