-
Notifications
You must be signed in to change notification settings - Fork 80
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
Always free the MQTTResponse #896
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. OpenSSF Scorecard
Scanned Files |
🔍 Vulnerabilities of
|
digest | sha256:8976e2640bb9e24e896d575207e7d277ef758050302b3c6bb72f8770a5364e41 |
vulnerabilities | |
size | 68 MB |
packages | 201 |
📦 Base Image debian:testing-20250224-slim
also known as |
|
digest | sha256:dd44ac7e9b6d7271b382c9bf5bce34920ecb1c3f2ec09426137a4e72de79fd11 |
vulnerabilities |
Description
Description
Description
Description
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
|
Freeing the response only on error is probably OK given the way we're using the API, but we might as well always free the response to be safe. The documentation gives very little clue about precisely when to use MQTTResponse_free. I see some mallocs of properties in the WAIT_FOR_CONNACK case in MQTTClient_connectURIVersion, which might indicate that on success there is memory to be freed, at least for MQTTClient_connect5.
What
In the MQTT library, also free the
MQTTResponse
on success.Previously we were only freeing on error.
Why
Freeing the response only on error is probably OK given the way we're using the API, but we might as well always free the response to be safe.
The documentation gives very little clue about precisely when to use
MQTTResponse_free
.I see some
malloc
s of properties in theWAIT_FOR_CONNACK
case inMQTTClient_connectURIVersion
, which might indicate that on success there is memory to be freed, at least forMQTTClient_connect5
.