-
Notifications
You must be signed in to change notification settings - Fork 33
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: query-watchdog: avoid issues on heap allocation failing #147
Conversation
coverity is moaning either due to slight code rearangement or new version/settings.
Having de-allocation in the reverse order compared to allocation seems to make gcc-12 static analysis of dynamic-memory-management happy.
cfcba33
to
48c9a11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
free(s_node); | ||
free(s_mbox); | ||
free(s_header); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't s_mbox be first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allocation is done header, mbox and then node - so doing it the opposite direction here ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... at least that far the theory why it seemed to be more pleased with what I changed around line 560. It actually never complained about this here and iirc at some point it even stopped complaining about the stuff around 560. Had the impression it was some kind of tuning when they brought gcc into fedora. Just to avoid it next time ;-)
test this please |
https://build.opensuse.org/request/show/1093863 by user yan_gao + dimstar_suse - Update to version 1.5.2+20230316.5ec38cf: - query-watchdog: avoid issues on heap allocation failing (gh#ClusterLabs/sbd#147) - Update to version 1.5.2+20230109.cf5c220 (v1.5.2): (forwarded request 1093862 from yan_gao)
coverity is moaning either due to slight code rearangement
or new version/settings.