Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

general/cppcheck: Address cppcheck memory related errors #9892

Closed
wants to merge 2 commits into from

Conversation

jlucovsky
Copy link
Contributor

Continuation of #9891

Address cppcheck reported memory leak/misuse errors. See the redmine issue for the cppcheck command that uncovered the issues.

Issue: 6527

Link to redmine ticket: 6527

Updates:

  • Split single commit.
  • Addressed review comments.

Provide values to any of the below to override the defaults.

To use a pull request use a branch name like pr/N where N is the
pull request number.

Alternatively, SV_BRANCH may also be a link to an
OISF/suricata-verify pull-request.

SV_REPO=
SV_BRANCH=
SU_REPO=
SU_BRANCH=
LIBHTP_REPO=
LIBHTP_BRANCH=

Issue: 6527

Ensure that the `map->string` memory isn't leaked following an error
return from `HashListTableAdd`
Issue: 6527

Address the FP raised by cppcheck -- note that although the code
corectly checks to ensure that `to_shift != &sb->reqion`, the logic was
detected as a FP. Rework the code to eliminate the FP.
Copy link

codecov bot commented Nov 25, 2023

Codecov Report

Merging #9892 (bd5d498) into master (d005fff) will decrease coverage by 0.09%.
The diff coverage is 61.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9892      +/-   ##
==========================================
- Coverage   82.45%   82.37%   -0.09%     
==========================================
  Files         972      972              
  Lines      273057   273062       +5     
==========================================
- Hits       225156   224923     -233     
- Misses      47901    48139     +238     
Flag Coverage Δ
fuzzcorpus 64.23% <61.11%> (-0.14%) ⬇️
suricata-verify 61.06% <16.66%> (-0.03%) ⬇️
unittests 62.92% <16.66%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 16727

@victorjulien victorjulien added this to the 8.0 milestone Dec 13, 2023
@victorjulien
Copy link
Member

Merged in #10043, thanks!

@jlucovsky jlucovsky deleted the 6527/4 branch December 19, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants