diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2013-03-01 18:30:00 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-03-01 16:43:57 -0500 |
commit | 45348240358d29c43f8d943b6c8f07dec5fbdb56 (patch) | |
tree | 735902b9b9aea1973aa2d97ea2f2975ee7cbf77c /src | |
parent | 684ecf306a2a9749fd4be28170b7d83252e7c590 (diff) |
systemd-analyze: free unit_times only if it is not NULL
Diffstat (limited to 'src')
-rw-r--r-- | src/analyze/systemd-analyze.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c index b7e16706cd..7603cc0de4 100644 --- a/src/analyze/systemd-analyze.c +++ b/src/analyze/systemd-analyze.c @@ -237,9 +237,11 @@ static int acquire_time_data(DBusConnection *bus, struct unit_times **out) *out = unit_times; return c; fail: - for (; c >= 0; c--) - free(unit_times[c].name); - free(unit_times); + if (unit_times) { + for (; c >= 0; c--) + free(unit_times[c].name); + free(unit_times); + } return r; } |