* [bluez/bluez] 2fe40b: shared/util: Fix warnings when cleaning up NULL po...
@ 2026-06-09 16:38 hadess
0 siblings, 0 replies; only message in thread
From: hadess @ 2026-06-09 16:38 UTC (permalink / raw)
To: linux-bluetooth
Branch: refs/heads/1108616
Home: https://github.com/bluez/bluez
Commit: 2fe40bee6c48c4d72506d98d3283b8d1e981a75d
https://github.com/bluez/bluez/commit/2fe40bee6c48c4d72506d98d3283b8d1e981a75d
Author: Bastien Nocera <hadess@hadess.net>
Date: 2026-06-09 (Tue, 09 Jun 2026)
Changed paths:
M src/shared/util.h
Log Message:
-----------
shared/util: Fix warnings when cleaning up NULL pointers
Don't try to free NULL pointers in cleanup callbacks, some of the
functions we use to free pointers might not support being passed
non-NULL values.
Fixes: 2e0533f977cc ("shared/util: Add helper for "cleanup" variable attribute")
Commit: c58eb86c244e8fbdc32f9d58f395ad387ca67f09
https://github.com/bluez/bluez/commit/c58eb86c244e8fbdc32f9d58f395ad387ca67f09
Author: Bastien Nocera <hadess@hadess.net>
Date: 2026-06-09 (Tue, 09 Jun 2026)
Changed paths:
M src/shared/util.h
Log Message:
-----------
shared/util: Better type-checking in _steal_* commands
Replace _steal_() and _steal_fd_() inline functions with macros, so that
we can have better type-checking. This would have avoided crashes seen
in the original patchset, where we passed a pointer instead of a pointer
to a pointer.
Example usage:
CLEANUP_FREEFUNC(GKeyFile, g_key_file_free);
GKeyfile *load_config(void) {
_cleanup_type_(GKeyFile) GKeyFile *keyfile = NULL;
[...]
return _steal_(keyfile);
}
static int open_file(void) {
_cleanup_fd_ int fd = -1;
[...]
return _steal_fd_(fd);
}
This is inspired by similar code in Pipewire's spa helpers, as pointed
out by Pauli Virtanen <pav@iki.fi>.
Commit: ab59047bfee892cae87896575ad65c8b6944e7da
https://github.com/bluez/bluez/commit/ab59047bfee892cae87896575ad65c8b6944e7da
Author: Bastien Nocera <hadess@hadess.net>
Date: 2026-06-09 (Tue, 09 Jun 2026)
Changed paths:
M doc/maintainer-guidelines.rst
Log Message:
-----------
doc: Recommend using _cleanup_ and friends
Commit: b6f94e7d47b312ab1d373abf9a7bf1d7d32d50b4
https://github.com/bluez/bluez/commit/b6f94e7d47b312ab1d373abf9a7bf1d7d32d50b4
Author: Bastien Nocera <hadess@hadess.net>
Date: 2026-06-09 (Tue, 09 Jun 2026)
Changed paths:
M src/main.c
Log Message:
-----------
main: Use _cleanup_() to simplify configuration parsing
Use helpers to simplify temporary string usage, and cleanup in error
paths.
Commit: 09fbfb78eb0834cdbe9f7353b186d481b17321f6
https://github.com/bluez/bluez/commit/09fbfb78eb0834cdbe9f7353b186d481b17321f6
Author: Bastien Nocera <hadess@hadess.net>
Date: 2026-06-09 (Tue, 09 Jun 2026)
Changed paths:
M client/mgmt.c
Log Message:
-----------
client: Use _cleanup_fd_ to simplify urandom access
fd gets auto-closed before exiting the scope.
Commit: e22bd838f275c5144501bbbf961b91a28871c9e0
https://github.com/bluez/bluez/commit/e22bd838f275c5144501bbbf961b91a28871c9e0
Author: Bastien Nocera <hadess@hadess.net>
Date: 2026-06-09 (Tue, 09 Jun 2026)
Changed paths:
M tools/btattach.c
Log Message:
-----------
btattach: Use _cleanup_fd_ to simplify error paths
Use _cleanup_fd_ and _steal_fd() to simplify error paths, and only
"steal" the file descriptor on success.
Compare: https://github.com/bluez/bluez/compare/2fe40bee6c48%5E...e22bd838f275
To unsubscribe from these emails, change your notification settings at https://github.com/bluez/bluez/settings/notifications
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-09 16:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 16:38 [bluez/bluez] 2fe40b: shared/util: Fix warnings when cleaning up NULL po hadess
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox