diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2022-02-15 14:27:29 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2022-02-16 15:28:28 -0500 |
commit | 7b38bc6694b5a9c55760b550a662cdfa6c9d39b4 (patch) | |
tree | 267dca213115a83b9e73f141f1d9cb7c34426490 | |
parent | 38f888616950fe9704bdba2ee7c8dc6b220b6b71 (diff) | |
download | openssl_tpm2_engine-7b38bc6694b5a9c55760b550a662cdfa6c9d39b4.tar.gz |
fix uninitialized variable
gcc-11 noticed parentHandle may be uninitialized if the first error
branch is taken, so fix it.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | tpm2-common.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tpm2-common.c b/tpm2-common.c index 9db6be4..ea48d45 100644 --- a/tpm2-common.c +++ b/tpm2-common.c @@ -1489,7 +1489,7 @@ int tpm2_load_engine_file(const char *filename, struct app_data **app_data, rc = tpm2_create(&tssContext, ad->dir); if (rc) { reason="tpm2_create"; - goto import_err; + goto import_no_flush_err; } parentHandle = tpm2_handle_int(tssContext, ad->parent); @@ -1531,6 +1531,7 @@ int tpm2_load_engine_file(const char *filename, struct app_data **app_data, import_err: tpm2_flush_srk(tssContext, parentHandle); + import_no_flush_err: TSS_Delete(tssContext); if (rc) { tpm2_error(rc, reason); |