diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-11-08 10:06:12 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-11-23 19:17:28 -0500 |
commit | 06d8d842e9de8656d9a46926e7ae7ff967b69ef8 (patch) | |
tree | fc82c087a4c61599ee5ec633c384583a8a39a7d1 /src/core/manager.c | |
parent | f44b9efcec4594eb8f843325ee3079b44fb8f24a (diff) |
manager: let manager_free() handle NULLs
This makes the calling code a bit simpler.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index 7abc8a9a5e..4c3264b373 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -889,11 +889,12 @@ static void manager_clear_jobs_and_units(Manager *m) { m->n_running_jobs = 0; } -void manager_free(Manager *m) { +Manager* manager_free(Manager *m) { UnitType c; int i; - assert(m); + if (!m) + return NULL; manager_clear_jobs_and_units(m); @@ -955,6 +956,7 @@ void manager_free(Manager *m) { hashmap_free(m->units_requiring_mounts_for); free(m); + return NULL; } int manager_enumerate(Manager *m) { |