summaryrefslogtreecommitdiff
path: root/src/home
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-04-28 18:46:36 +0900
committerGitHub <noreply@github.com>2023-04-28 18:46:36 +0900
commit75fd8ad0083cc3542367ee44efa70258c29aecc8 (patch)
treef2df1ae517241c9c5fa561bd9ad691d38b8d1e08 /src/home
parentc63dde809951496a5e9c5a568aadfb9cad95e5e5 (diff)
parent360179ea4621a65e9993782bfe28ac4168a7e254 (diff)
downloadsystemd-75fd8ad0083cc3542367ee44efa70258c29aecc8.tar.gz
Merge pull request #27424 from dtardon/auto-cleanup
More automatic cleanup
Diffstat (limited to 'src/home')
-rw-r--r--src/home/homed-manager-bus.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/home/homed-manager-bus.c b/src/home/homed-manager-bus.c
index 0c0c292a70..ca639ae39e 100644
--- a/src/home/homed-manager-bus.c
+++ b/src/home/homed-manager-bus.c
@@ -385,7 +385,7 @@ static int method_register_home(
_cleanup_(user_record_unrefp) UserRecord *hr = NULL;
Manager *m = ASSERT_PTR(userdata);
- Home *h;
+ _cleanup_(home_freep) Home *h = NULL;
int r;
assert(message);
@@ -413,10 +413,10 @@ static int method_register_home(
return r;
r = home_save_record(h);
- if (r < 0) {
- home_free(h);
+ if (r < 0)
return r;
- }
+
+ TAKE_PTR(h);
return sd_bus_reply_method_return(message, NULL);
}