From 75db809ae583ef7287e39738195c0825c3070843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 16 Feb 2021 13:48:04 +0100 Subject: 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. --- src/shared/bus-wait-for-jobs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/shared/bus-wait-for-jobs.c') 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) { -- cgit v1.2.1