analyze: avoid a null dereference
If we have an error in the early sd_bus_* calls then unit_times will still be null. Found with coverity. Fixes: CID#996464
This commit is contained in:
@@ -277,7 +277,8 @@ static int acquire_time_data(sd_bus *bus, struct unit_times **out) {
|
||||
return c;
|
||||
|
||||
fail:
|
||||
free_unit_times(unit_times, (unsigned) c);
|
||||
if (unit_times)
|
||||
free_unit_times(unit_times, (unsigned) c);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user