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 #9849

Closed
wants to merge 1 commit into from

Conversation

jlucovsky
Copy link
Contributor

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

Describe changes:

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=

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

Issue: 6527
src/detect-engine-address.c Show resolved Hide resolved
if (map->string)
SCFree(map->string);
SCFree(map);
BUG_ON(true);
Copy link
Member

Choose a reason for hiding this comment

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

should be return -1;?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will modify function signature to return a bool and ensure the caller checks the return value.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 16659

@jlucovsky
Copy link
Contributor Author

Continued in #9866

@jlucovsky jlucovsky closed this Nov 22, 2023
@jlucovsky jlucovsky deleted the 6527/1 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