diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-09-11 23:41:44 +0200 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-09-11 23:45:36 +0200 |
commit | d725a138c5c311ba06567d6841933aa5b7b6a435 (patch) | |
tree | 92da3ce3ad44972dbaea681c744227fd43c37106 | |
parent | 671174136525ddf208cdbe75d6d6bd159afa961f (diff) |
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
-rw-r--r-- | src/analyze/analyze.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index d860a022b7..1281d6b9ea 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -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; } |