diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2015-08-17 10:45:30 +0200 |
---|---|---|
committer | Markus Elfring <elfring@users.sourceforge.net> | 2015-08-17 10:45:30 +0200 |
commit | 3e044c492e3ebe64f4e3175c94f9db8a62557b82 (patch) | |
tree | 162e76658ef1e646546eca079d08e0143c4747b6 /src/core | |
parent | dc4ebc0787a299f064553e6d28a7f35574ce1c2a (diff) |
Bug #944: Deletion of unnecessary checks before a few calls of systemd functions
The following functions return immediately if a null pointer was passed.
* calendar_spec_free
* link_address_free
* manager_free
* sd_bus_unref
* sd_journal_close
* udev_monitor_unref
* udev_unref
It is therefore not needed that a function caller repeats a corresponding check.
This issue was fixed by using the software Coccinelle 1.0.1.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/dbus-timer.c | 3 | ||||
-rw-r--r-- | src/core/timer.c | 5 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c index 74a9914358..8ea2cf84a4 100644 --- a/src/core/dbus-timer.c +++ b/src/core/dbus-timer.c @@ -252,8 +252,7 @@ static int bus_timer_set_transient_property( v = new0(TimerValue, 1); if (!v) { - if (c) - calendar_spec_free(c); + calendar_spec_free(c); return -ENOMEM; } diff --git a/src/core/timer.c b/src/core/timer.c index 51cd56ca84..7027f83dfd 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -56,10 +56,7 @@ void timer_free_values(Timer *t) { while ((v = t->values)) { LIST_REMOVE(value, t->values, v); - - if (v->calendar_spec) - calendar_spec_free(v->calendar_spec); - + calendar_spec_free(v->calendar_spec); free(v); } } |