Skip to content

Fix unsafe realloc#141

Open
jserv wants to merge 1 commit intotaviso:mainfrom
jserv:unsafe-realloc
Open

Fix unsafe realloc#141
jserv wants to merge 1 commit intotaviso:mainfrom
jserv:unsafe-realloc

Conversation

@jserv
Copy link
Contributor

@jserv jserv commented Feb 20, 2026

realloc() result was assigned directly to pmkrelocs, leaking the old allocation and dereferencing NULL on failure. Use a temporary pointer with an error check before assignment.

realloc() result was assigned directly to pmkrelocs, leaking the old
allocation and dereferencing NULL on failure. Use a temporary pointer
with an error check before assignment.
@taviso
Copy link
Owner

taviso commented Feb 21, 2026

Thanks for the patch! I guess you're right, but this is only used during the build process - so I'm not sure it really matters if the exit code is 1 or 139 because it's interpreted by make, not the user... I don't know, do you have a strong opinion? :)

@jserv
Copy link
Contributor Author

jserv commented Feb 21, 2026

this is only used during the build process - so I'm not sure it really matters if the exit code is 1 or 139 because it's interpreted by make, not the user... I don't know, do you have a strong opinion? :)

I plan to enable GitHub Actions with integrated static analysis. This issue was identified by the static analyzer.

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