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: query-watchdog: avoid issues on heap allocation failing #147

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

wenningerk
Copy link

coverity is moaning either due to slight code rearangement
or new version/settings.

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.
Copy link

@kgaillot kgaillot 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 to me

free(s_node);
free(s_mbox);
free(s_header);
Copy link

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?

Copy link
Author

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 ...

Copy link
Author

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 ;-)

@wenningerk wenningerk changed the title [WIP] Fix: query-watchdog: avoid issues on heap allocation failing Fix: query-watchdog: avoid issues on heap allocation failing Mar 16, 2023
@wenningerk
Copy link
Author

test this please

@wenningerk wenningerk merged commit 5ec38cf into ClusterLabs:main Mar 16, 2023
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Jun 20, 2023
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)
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