summaryrefslogtreecommitdiffstats
path: root/src/shared/bus-wait-for-jobs.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-16 13:48:04 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-16 17:15:10 +0100
commit75db809ae583ef7287e39738195c0825c3070843 (patch)
tree9793b944d340516003c0fc10ccb9322a4e126721 /src/shared/bus-wait-for-jobs.c
parentnetworkd: make network_config_section_free() inline (diff)
downloadsystemd-75db809ae583ef7287e39738195c0825c3070843.tar.xz
systemd-75db809ae583ef7287e39738195c0825c3070843.zip
tree-wide: return NULL from freeing functions
I started working on this because I wanted to change how DEFINE_TRIVIAL_CLEANUP_FUNC is defined. Even independently of that change, it's nice to make make things more consistent and predictable.
Diffstat (limited to 'src/shared/bus-wait-for-jobs.c')
-rw-r--r--src/shared/bus-wait-for-jobs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/bus-wait-for-jobs.c b/src/shared/bus-wait-for-jobs.c
index 005294c33a..80f7785323 100644
--- a/src/shared/bus-wait-for-jobs.c
+++ b/src/shared/bus-wait-for-jobs.c
@@ -61,9 +61,9 @@ static int match_job_removed(sd_bus_message *m, void *userdata, sd_bus_error *er
return 0;
}
-void bus_wait_for_jobs_free(BusWaitForJobs *d) {
+BusWaitForJobs* bus_wait_for_jobs_free(BusWaitForJobs *d) {
if (!d)
- return;
+ return NULL;
set_free(d->jobs);
@@ -75,7 +75,7 @@ void bus_wait_for_jobs_free(BusWaitForJobs *d) {
free(d->name);
free(d->result);
- free(d);
+ return mfree(d);
}
int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) {