Re: linux-5.8-rc4/scripts/kconfig/qconf.cc: 2 * bad delete ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 29, 2020 at 3:28 PM David Binderman <dcb314@xxxxxxxxxxx> wrote:
>
> Hello there,
>
> >Will you send a patch, or shall I do it?
>
> Option 2 please. I gave up doing kernel patches a long time ago.

OK, I will send a patch.


> >Could you please teach me how to reproduce them?
>
> --language=c++ looks like a good candidate for a fix.
>
> Regards
>
> David Binderman
>

--language=c++ made no difference, but
I figured out why cppcheck did not work for me.


If scripts/kconfig/qconf.moc is remaining,
cppcheck does not work.


After I deleted it, cppcheck worked for me.


masahiro@oscar:~/workspace/linux$ make build_xconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/images.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  UPD     scripts/kconfig/qconf-cfg
  MOC     scripts/kconfig/qconf.moc
  HOSTCXX scripts/kconfig/qconf.o
  HOSTLD  scripts/kconfig/qconf
masahiro@oscar:~/workspace/linux$ cppcheck  scripts/kconfig/qconf.cc
Checking scripts/kconfig/qconf.cc ...
masahiro@oscar:~/workspace/linux$ rm -f scripts/kconfig/qconf.moc
masahiro@oscar:~/workspace/linux$ cppcheck  scripts/kconfig/qconf.cc
Checking scripts/kconfig/qconf.cc ...
scripts/kconfig/qconf.cc:1242:10: error: Mismatching allocation and
deallocation: data [mismatchAllocDealloc]
  delete data;
         ^
scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and
deallocation: data
 char *data = new char[count + 1];
              ^
scripts/kconfig/qconf.cc:1242:10: note: Mismatching allocation and
deallocation: data
  delete data;
         ^
scripts/kconfig/qconf.cc:1255:10: error: Mismatching allocation and
deallocation: data [mismatchAllocDealloc]
  delete data;
         ^
scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and
deallocation: data
 char *data = new char[count + 1];
              ^
scripts/kconfig/qconf.cc:1255:10: note: Mismatching allocation and
deallocation: data
  delete data;
         ^








-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux