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

Fix invalid call to free() in 'addServiceRecord' #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jf-0
Copy link

@jf-0 jf-0 commented Jun 28, 2023

If some memory allocation in the member function addServiceRecord fails it will call 'goto errorReturn;'.
At errorReturn there is a call to my_free which ALWAYS frees 'record->servName' at the moment.

This PR sets servName to 0, which will later prevent the call to free (if it is called too early)

Live-Screenshot of the bug:
image
assert failed: heap_caps_free heap_caps.c:360 (heap != NULL && "free() target pointer is outside heap areas"

assert failed: heap_caps_free heap_caps.c:360 (heap != NULL && "free() target pointer is outside heap areas"
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants