Skip to content

Issue 5105 - lmdb - Cannot create entries with long rdn - fix covscan #6131

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

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

progier389
Copy link
Contributor

@progier389 progier389 commented Mar 25, 2024

A minor code cleanup issue fixing: CID 1540880 CID 1540879 CID 1540878 CID 1540876 CID 1540875
All these report have the same pattern but on different function.
The issue is that ctx == NULL is tested as part of the parameter validity tests (even if it is never NULL)
then goto bail but the bail code dereference ctx to potentially free some resources.
So I changed the code from:
Log Entering in Function
If (One of parameter is NULL) {
Log Error message
goto bail
}
To:
If (One of parameter is NULL) {
Log Error message
return -1;
}
Log Entering in Function
CID 1540877 is a real issue about a potential memory leak in case of error (shoud goto bail0 instead of bail to make sure childelem is free)

Issue: #6105

Reviewed by: @droideck Thanks!

Copy link
Member

@droideck droideck left a comment

Choose a reason for hiding this comment

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

Looks good!

@progier389 progier389 merged commit b295604 into 389ds:main Mar 26, 2024
progier389 added a commit that referenced this pull request May 30, 2024
…#6131)

A minor code cleanup issue fixing: CID 1540880 CID 1540879 CID 1540878 CID 1540876 CID 1540875
All these report have the same pattern but on different function.
The issue is that ctx == NULL is tested as part of the parameter validity tests (even if it is never NULL)
then goto bail but the bail code dereference ctx to potentially free some resources.
So I changed the code from:
Log Entering in Function
If (One of parameter is NULL) {
Log Error message
goto bail
}
To:
If (One of parameter is NULL) {
Log Error message
return -1;
}
Log Entering in Function
CID 1540877 is a real issue about a potential memory leak in case of error (shoud goto bail0 instead of bail to make sure childelem is free)

Issue: #6105

Reviewed by: @droideck Thanks!

(cherry picked from commit b295604)
progier389 added a commit that referenced this pull request May 31, 2024
…#6131)

A minor code cleanup issue fixing: CID 1540880 CID 1540879 CID 1540878 CID 1540876 CID 1540875
All these report have the same pattern but on different function.
The issue is that ctx == NULL is tested as part of the parameter validity tests (even if it is never NULL)
then goto bail but the bail code dereference ctx to potentially free some resources.
So I changed the code from:
Log Entering in Function
If (One of parameter is NULL) {
Log Error message
goto bail
}
To:
If (One of parameter is NULL) {
Log Error message
return -1;
}
Log Entering in Function
CID 1540877 is a real issue about a potential memory leak in case of error (shoud goto bail0 instead of bail to make sure childelem is free)

Issue: #6105

Reviewed by: @droideck Thanks!

(cherry picked from commit b295604)
@progier389 progier389 deleted the i6105_covscan branch May 20, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants