diff options
| author | Peter Jones <pjones@redhat.com> | 2017-09-27 13:45:21 -0400 |
|---|---|---|
| committer | Peter Jones <pmjones@gmail.com> | 2018-03-12 16:21:43 -0400 |
| commit | 70a4c4a39522a4d88dda0ce17a0219b10092586a (patch) | |
| tree | 38ee9b76b75bee0fc768dfece3c509dcc94a2a5b /lib/variables.c | |
| parent | 7ee19bdc41d2209fbe25d2e4be812245b94b5457 (diff) | |
| download | efi-boot-shim-70a4c4a39522a4d88dda0ce17a0219b10092586a.tar.gz efi-boot-shim-70a4c4a39522a4d88dda0ce17a0219b10092586a.zip | |
lib: simple_file_selector(): simplify the error path to confuse covscan less.
Because they don't believe code should be defensive against future
changes, covscan believes:
520 out_free:
521 FreePool(dmp);
CID 182824 (#1 of 1): Dereference before null check
(REVERSE_INULL)check_after_deref: Null-checking entries suggests that
it may be null, but it has already been dereferenced on all paths
leading to the check.
522 if (entries) {
523 free_entries(entries, count);
524 FreePool(entries);
525 }
526 out_free_name:
527 FreePool(name);
528}
Which is technically correct, but still kind of dumb. So this patch
combines the two error out paths into just being out_free, so that the
first path there is before entries is allocated. (It also initializes
dmp to NULL and checks that before freeing it.)
I also Lindent-ed that function.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'lib/variables.c')
0 files changed, 0 insertions, 0 deletions
