Skip to content

notification: Ensure that g_autoptr variable is initialized#180

Merged
TingPing merged 1 commit intoflatpak:mainfrom
smcv:autofree
Jan 1, 2025
Merged

notification: Ensure that g_autoptr variable is initialized#180
TingPing merged 1 commit intoflatpak:mainfrom
smcv:autofree

Conversation

@smcv
Copy link
Copy Markdown
Contributor

@smcv smcv commented Jan 1, 2025

If the function early-returns (which it currently does not, but that would be a reasonable change to make) then we'd call g_object_unref() on uninitialized stack memory. gcc 14.2.0 in the freedesktop SDK 24.08 warns about this.

It's better to make sure that every autofreed variable is initialized, possibly to NULL.

If the function early-returns (which it currently does not, but that
would be a reasonable change to make) then we'd call g_object_unref()
on uninitialized stack memory. gcc 14.2.0 in the freedesktop SDK 24.08
warns about this.

It's better to make sure that every autofreed variable is initialized,
possibly to NULL.

Signed-off-by: Simon McVittie <smcv@debian.org>
@TingPing TingPing merged commit 6819ada into flatpak:main Jan 1, 2025
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