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

7302 init parser after check with stat() #11867

Closed
wants to merge 1 commit into from

Conversation

zemeteri
Copy link
Contributor

@zemeteri zemeteri commented Oct 3, 2024

Make sure these boxes are checked accordingly before submitting your Pull Request -- thank you.

Contribution style:

Our Contribution agreements:

Changes (if applicable):

Link to ticket: https://redmine.openinfosecfoundation.org/issues/7302

Describe changes:

  • move parser initializing code below checking file with stat() function (to prevent possible memory leak)

Copy link
Contributor

@jufajardini jufajardini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for reporting this and sharing a possible patch.

Could you please add a brief explanation in the commit message body about why was it necessary? It help even when reviewing, if the issue isn't immediately apparent to the reviewer :)

We will also need a couple of adjusts to the commit, before patches can be merged:

  • adjust the commit message following our guidelines
  • adjust the author name to be in human readable format? :P We use the FirstName LastName format

Copy link

github-actions bot commented Oct 3, 2024

NOTE: This PR may contain new authors.

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.69%. Comparing base (501f79c) to head (2cca563).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11867      +/-   ##
==========================================
- Coverage   82.56%   77.69%   -4.87%     
==========================================
  Files         912      912              
  Lines      249354   249329      -25     
==========================================
- Hits       205880   193724   -12156     
- Misses      43474    55605   +12131     
Flag Coverage Δ
fuzzcorpus ?
livemode 18.72% <33.33%> (ø)
pcap 44.08% <0.00%> (-0.01%) ⬇️
suricata-verify 62.00% <33.33%> (-0.01%) ⬇️
unittests 58.93% <0.00%> (ø)

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

@zemeteri zemeteri force-pushed the 7302-fix-mem-leak-conf-parser branch from 508e183 to 2cca563 Compare October 4, 2024 08:14
@zemeteri
Copy link
Contributor Author

zemeteri commented Oct 4, 2024 via email

Copy link

github-actions bot commented Oct 4, 2024

NOTE: This PR may contain new authors.

@victorjulien victorjulien added this to the 8.0 milestone Oct 8, 2024
Commit changes are made to avoid possible memory leaks. If the parser
is initialized before configuration file checking, there was no deinit
call before function return. Do check config file existance and type
before YAML parser initialization, so we don't need to deinit parser
before exiting the function.

Bug: OISF#7302
@zemeteri zemeteri force-pushed the 7302-fix-mem-leak-conf-parser branch from 2cca563 to 381334f Compare October 8, 2024 10:29
@victorjulien victorjulien self-requested a review October 8, 2024 11:00
@victorjulien
Copy link
Member

Please open a new PR when implementing changes.

@zemeteri zemeteri closed this Oct 10, 2024
@zemeteri
Copy link
Contributor Author

zemeteri commented Oct 10, 2024 via email

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