From: Lukas Nykryn Date: Fri, 1 Mar 2013 17:30:00 +0000 (+0100) Subject: systemd-analyze: free unit_times only if it is not NULL X-Git-Tag: v198~119 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=45348240358d29c43f8d943b6c8f07dec5fbdb56 systemd-analyze: free unit_times only if it is not NULL --- diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c index b7e16706c..7603cc0de 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; }