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:
Thomas Hindoe Paaboel Andersen 2014-09-11 23:41:44 +02:00
parent 6711741365
commit d725a138c5

View file

@ -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;
}