[mythtv-commits] [MythTV/mythtv] ced028: tidy: Silence false positive memory leak warnings.

linuxdude42 noreply at github.com
Sat May 30 01:47:09 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/MythTV/mythtv
  Commit: ced028157687b90ee4cc0e15dc5a2f1858153c5a
      https://github.com/MythTV/mythtv/commit/ced028157687b90ee4cc0e15dc5a2f1858153c5a
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythplugins/mythmusic/mythmusic/playlisteditorview.cpp
    M mythtv/libs/libmythtv/captions/subtitlescreen.cpp
    M mythtv/programs/mythbackend/main_helpers.cpp
    M mythtv/programs/mythfrontend/customedit.cpp
    M mythtv/programs/mythfrontend/videofileassoc.cpp

  Log Message:
  -----------
  tidy: Silence false positive memory leak warnings.

There are a couple of places that clang-tidy raises warnings that
newly allocated objects are leaked.  In all of these cases, the
objects is placed on a list, either inside the constructor or in
another functions.

https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer-cplusplus.NewDeleteLeaks.html


  Commit: 63ac19840f48d480cb129b9eff121e5271b7300d
      https://github.com/MythTV/mythtv/commit/63ac19840f48d480cb129b9eff121e5271b7300d
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythtv/programs/mythbackend/main_helpers.cpp
    M mythtv/programs/mythexternrecorder/main.cpp

  Log Message:
  -----------
  tidy: Fix a couple of trivial memory leaks.

Fix a couple of trivial memory leaks in program initialization.

https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer-cplusplus.NewDeleteLeaks.html


  Commit: 565b924db11f7d97ce7a50bb4910f440066c0cf5
      https://github.com/MythTV/mythtv/commit/565b924db11f7d97ce7a50bb4910f440066c0cf5
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythtv/programs/mythmetadatalookup/main.cpp

  Log Message:
  -----------
  tidy: Fix a trivial memory leak in mythmetadatalookup.

Fix a trivial memory leak by using a std::unique_ptr.

https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer-cplusplus.NewDeleteLeaks.html


  Commit: 50a17cbc02fc8ccff1d375dd71a4b1ca1a5744cf
      https://github.com/MythTV/mythtv/commit/50a17cbc02fc8ccff1d375dd71a4b1ca1a5744cf
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythtv/programs/mythtv-setup/main.cpp

  Log Message:
  -----------
  tidy: Fix a memory leak in mythtv-setup.

This program allocates wither a QCoreApplication object or a
QApplication object using the "new" operator.  Clang-tidy flags this
as a memory leak as there is no corresponding "delete" operator.  (Its
there, just hidden elsewhere.)  This can't be converted to RAII
because the application object would get cleaned up too soon, so move
the explicit delete into the main function instead of having it
elsewhere.

https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer-cplusplus.NewDeleteLeaks.html


  Commit: 46c6b0d491fb625c27b060a5fc90afd67a0d3769
      https://github.com/MythTV/mythtv/commit/46c6b0d491fb625c27b060a5fc90afd67a0d3769
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythtv/programs/mythscreenwizard/main.cpp

  Log Message:
  -----------
  tidy: Fix a memory leak in mythscreenwizard.

This program allocates the QApplication object using the "new"
operator.  Clang-tidy flags this as a memory leak as there is no
corresponding "delete" operator.  (Its there, just hidden elsewhere.)
Convert this to RAII so that the delete happens automatically in the
stack cleanup and clang-tidy understands that the object is deleted.

https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer-cplusplus.NewDeleteLeaks.html


  Commit: a2b3be8368a09af79258af42b5c9cbade34ae157
      https://github.com/MythTV/mythtv/commit/a2b3be8368a09af79258af42b5c9cbade34ae157
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythtv/programs/mythfrontend/main.cpp

  Log Message:
  -----------
  tidy: Fix a couple of memory leaks in mythfrontend.

This program allocates the QApplication object using the "new"
operator.  Clang-tidy flags this as a memory leak as there is no
corresponding "delete" operator.  (Its there, just hidden elsewhere.)
Convert this to RAII so that the delete happens automatically in the
stack cleanup and clang-tidy understands that the object is deleted.

There are also two other memory leaks that are fixed with a
combination of RAII and unique pointers.

https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer-cplusplus.NewDeleteLeaks.html


  Commit: d4db6c8996894b1e0eb41465474d62edc2fe477f
      https://github.com/MythTV/mythtv/commit/d4db6c8996894b1e0eb41465474d62edc2fe477f
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythtv/programs/mythcommflag/BlankFrameDetector.cpp
    M mythtv/programs/mythcommflag/BlankFrameDetector.h
    M mythtv/programs/mythcommflag/CommDetector2.cpp
    M mythtv/programs/mythcommflag/FrameAnalyzer.h
    M mythtv/programs/mythcommflag/HistogramAnalyzer.cpp
    M mythtv/programs/mythcommflag/HistogramAnalyzer.h
    M mythtv/programs/mythcommflag/SceneChangeDetector.cpp
    M mythtv/programs/mythcommflag/SceneChangeDetector.h
    M mythtv/programs/mythcommflag/TemplateFinder.cpp
    M mythtv/programs/mythcommflag/TemplateFinder.h
    M mythtv/programs/mythcommflag/TemplateMatcher.cpp
    M mythtv/programs/mythcommflag/TemplateMatcher.h

  Log Message:
  -----------
  tidy: Fix a couple of memory leaks in mythcommflag.

Use unique pointers to fix a couple of potential memory leaks flagged
by clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer-cplusplus.NewDeleteLeaks.html


  Commit: 6c57bec6f76ade01609983c31d64155c7dcb5a57
      https://github.com/MythTV/mythtv/commit/6c57bec6f76ade01609983c31d64155c7dcb5a57
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythtv/programs/mythfrontend/progdetails.cpp

  Log Message:
  -----------
  tidy: Fix potential null dereference in mythfrontend.

Clang-tidy is reporting a potential null dereference in the loadPage
function.  Two of the three places in this function that dereference
the record variable test its validity before dereferencing it.  Add a
validity check to the third place the variable is dereferenced.

https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer-core.NullDereference.html


  Commit: 35bf1b7f5e71f30579df8ccea9897ee823093004
      https://github.com/MythTV/mythtv/commit/35bf1b7f5e71f30579df8ccea9897ee823093004
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythtv/libs/libmythtv/recordingprofile.cpp

  Log Message:
  -----------
  tidy: Fix a potential memory leaks in recordeingprofile.cpp.

The VideoCompressionSettings constructor has a memory leak when the
dynamic_res variable is set to false.  The code unconditionally
allocates three data structures, and uses all of them when dynamic_res
it true, but only uses one of them when dynamic_res is false.  Add
code to the false case to delete the two unused structure.

Use unique pointers to fix a couple of potential memory leaks flagged
by clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/clang-analyzer-cplusplus.NewDeleteLeaks.html


  Commit: a180830eef9aabe955159b6259da3068c9e4e961
      https://github.com/MythTV/mythtv/commit/a180830eef9aabe955159b6259da3068c9e4e961
  Author: David Hampton <mythtv at love2code.net>
  Date:   2020-05-29 (Fri, 29 May 2020)

  Changed paths:
    M mythtv/libs/libmythtv/mpeg/freesat_tables.cpp

  Log Message:
  -----------
  Fix 'visibility' attribute ignored warning message.


Compare: https://github.com/MythTV/mythtv/compare/747ffc7dbc8a...a180830eef9a


More information about the mythtv-commits mailing list