From 45348240358d29c43f8d943b6c8f07dec5fbdb56 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Fri, 1 Mar 2013 18:30:00 +0100 Subject: systemd-analyze: free unit_times only if it is not NULL --- src/analyze/systemd-analyze.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/analyze') 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; } -- cgit v1.2.3-54-g00ecf