Package: cppcheck-gui
Version: 1.86-1
Severity: normal

Dear Maintainer,

a memory leak error is not visible in gui. When using the version from stretch 
the error is visible again.

Small example:
...
#include <QString>
#include <iostream>

class TestType {
public:
   char ca[12];
   int ul;
   double d;
};

char* rawData()
{
        static char data[] = "ASDFASDGASDGSG";
        return data;
}

QString foo()
{
        int type = 0x100;
        if ( type == 0x100 ) {
                TestType *tt = new TestType();
                tt=(TestType *)rawData(); //<-memleak
                return QString(tt->ca)+" "+QString::number(tt->ul)+" 
"+QString::number(tt->d);
                delete tt; // <- never come here ...
        }
        else{
                return QString("Else");
        }
}

int main()
{
        QString test = foo();
        std::cout << test.toStdString() << std::endl;
        return 0;
}
...

I just removed this complete stupid code from the project, but I wonder
why the error is visible in 1.76-1 and its not in 1.86-1 when using
the same data base.

Regards
Gavin


-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cppcheck-gui depends on:
ii  libc6                2.28-7
ii  libgcc1              1:8.2.0-21
ii  libgl1               1.1.0-1
ii  libpcre3             2:8.39-11
ii  libqt5core5a         5.11.3+dfsg-5
ii  libqt5gui5           5.11.3+dfsg-5
ii  libqt5printsupport5  5.11.3+dfsg-5
ii  libqt5widgets5       5.11.3+dfsg-5
ii  libstdc++6           8.2.0-21
ii  libtinyxml2-6a       7.0.0+dfsg-1

cppcheck-gui recommends no packages.

Versions of packages cppcheck-gui suggests:
ii  clang    1:7.0-47
ii  python3  3.7.2-1

-- no debconf information

Reply via email to