summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/dynamic-user.c4
-rw-r--r--src/core/execute.c4
-rw-r--r--src/core/manager.c3
-rw-r--r--src/core/transaction.c6
-rw-r--r--src/core/unit.c6
5 files changed, 7 insertions, 16 deletions
diff --git a/src/core/dynamic-user.c b/src/core/dynamic-user.c
index 1043da3eb7..e1846e1adb 100644
--- a/src/core/dynamic-user.c
+++ b/src/core/dynamic-user.c
@@ -42,9 +42,7 @@ static DynamicUser* dynamic_user_free(DynamicUser *d) {
(void) hashmap_remove(d->manager->dynamic_users, d->name);
safe_close_pair(d->storage_socket);
- free(d);
-
- return NULL;
+ return mfree(d);
}
static int dynamic_user_add(Manager *m, const char *name, int storage_socket[2], DynamicUser **ret) {
diff --git a/src/core/execute.c b/src/core/execute.c
index 869522704a..59c2bd0dd2 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -3740,9 +3740,7 @@ ExecRuntime *exec_runtime_unref(ExecRuntime *r) {
free(r->tmp_dir);
free(r->var_tmp_dir);
safe_close_pair(r->netns_storage_socket);
- free(r);
-
- return NULL;
+ return mfree(r);
}
int exec_runtime_serialize(Unit *u, ExecRuntime *rt, FILE *f, FDSet *fds) {
diff --git a/src/core/manager.c b/src/core/manager.c
index 3569249788..50aae0d1ba 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1119,8 +1119,7 @@ Manager* manager_free(Manager *m) {
hashmap_free(m->uid_refs);
hashmap_free(m->gid_refs);
- free(m);
- return NULL;
+ return mfree(m);
}
void manager_enumerate(Manager *m) {
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 8370b864fb..e22e3b30c2 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -1085,10 +1085,8 @@ Transaction *transaction_new(bool irreversible) {
return NULL;
tr->jobs = hashmap_new(NULL);
- if (!tr->jobs) {
- free(tr);
- return NULL;
- }
+ if (!tr->jobs)
+ return mfree(tr);
tr->irreversible = irreversible;
diff --git a/src/core/unit.c b/src/core/unit.c
index 67668bdc48..a6b8ecdcb7 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -88,10 +88,8 @@ Unit *unit_new(Manager *m, size_t size) {
return NULL;
u->names = set_new(&string_hash_ops);
- if (!u->names) {
- free(u);
- return NULL;
- }
+ if (!u->names)
+ return mfree(u);
u->manager = m;
u->type = _UNIT_TYPE_INVALID;