summaryrefslogtreecommitdiff
path: root/src/analyze/analyze.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-09-11 23:41:44 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-09-11 23:45:36 +0200
commitd725a138c5c311ba06567d6841933aa5b7b6a435 (patch)
tree92da3ce3ad44972dbaea681c744227fd43c37106 /src/analyze/analyze.c
parent671174136525ddf208cdbe75d6d6bd159afa961f (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
Diffstat (limited to 'src/analyze/analyze.c')
-rw-r--r--src/analyze/analyze.c3
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;
}