Skip to content

Commit

Permalink
policylib: Fix leaks in policylib tests.
Browse files Browse the repository at this point in the history
Leaks in the unit and integration test for policylib were fixed.

Signed-off-by: Juergen Repp <[email protected]>
  • Loading branch information
JuergenReppSIT authored and William Roberts committed Nov 8, 2022
1 parent 1168ca9 commit 7883402
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/integration/policy-execute.int.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ static TSS2_RC sign_cb (
assert(false);
}

if (pub_key)
EVP_PKEY_free(pub_key);
if (priv_key)
EVP_PKEY_free(priv_key);
if (bio)
Expand Down Expand Up @@ -549,6 +551,7 @@ static TSS2_RC polauth_cb (
memcpy(cbdata->update_digest.buffer, buffer,
cbdata->update_digest.size);
}
SAFE_FREE(digest);

return TSS2_RC_SUCCESS;
}
Expand Down
1 change: 1 addition & 0 deletions test/unit/tss2_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ static void test_policy_instantiate (
}

SAFE_FREE(json);
SAFE_FREE(buffer);
Tss2_PolicyFinalize(&ctx);
} /* end for each hash algorithm */
} /* end for each policy file */
Expand Down

0 comments on commit 7883402

Please sign in to comment.