mirror of
https://github.com/systemd/systemd.git
synced 2024-11-07 09:56:51 +03:00
systemd-analyze: free unit_times only if it is not NULL
This commit is contained in:
parent
684ecf306a
commit
4534824035
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user