[PATCH] cmd/gpt: Address error cases during gpt rename more correctly
authorTom Rini <trini@konsulko.com>
Tue, 21 Jan 2020 16:53:38 +0000 (11:53 -0500)
committerVagrant Cascadian <vagrant@debian.org>
Thu, 13 Feb 2020 06:29:38 +0000 (06:29 +0000)
commite24fc4f67e074ff82c814322a1116ae01648163d
treefa831890e3609cf2c2b706e2da1a35de810a9586
parent4522e99f502b8fc1fc82cbe920e93b802481002c
[PATCH] cmd/gpt: Address error cases during gpt rename more correctly

New analysis by the tool has shown that we have some cases where we
weren't handling the error exit condition correctly.  When we ran into
the ENOMEM case we wouldn't exit the function and thus incorrect things
could happen.  Rework the unwinding such that we don't need a helper
function now and free what we may have allocated.

Fixes: 18030d04d25d ("GPT: fix memory leaks identified by Coverity")
Reported-by: Coverity (CID: 275475, 275476)
Cc: Alison Chaiken <alison@she-devel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Jordy <jordy@simplyhacker.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Gbp-Pq: Topic security
Gbp-Pq: Name CVE-2020-8432-cmd-gpt-Address-error-cases-during-gpt-rename-more-c.patch
cmd/gpt.c