]> git.ipfire.org Git - thirdparty/systemd.git/commit
analyze: use _cleanup_ for struct unit_times
authorFilipe Brandenburger <filbranden@google.com>
Wed, 6 Jun 2018 16:43:37 +0000 (09:43 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 8 Jun 2018 13:46:07 +0000 (15:46 +0200)
commitdf560cf6b13c6133014c7ff07b2fd2f2b62996c1
tree5d69550f2e08abbf8c1dccee62e112fff0344d31
parent89278d96dcbb98ca219b233d454e18cd18501e3a
analyze: use _cleanup_ for struct unit_times

This introduces a has_data boolean field in struct unit_files which can
be used to detect the end of the array.

Use a _cleanup_ for struct unit_files in acquire_time_data and its
callers. Code for acquire_time_data is also simplified by replacing
goto's with straight returns.

Tested: By running the commands below, also checking them under valgrind.
  - build/systemd-analyze blame
  - build/systemd-analyze critical-chain
  - build/systemd-analyze plot

Fixes: Coverity finding CID 996464.
src/analyze/analyze.c