Here is fix for the first memory leak.  Let me know if this will suffice.
Should have another for tspi_certify tomorrow.

Signed-off-by: Ceri Coburn <[email protected]>
---
 src/tspi/tspi_aik.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/tspi/tspi_aik.c b/src/tspi/tspi_aik.c
index 54dd729..3d041b9 100644
--- a/src/tspi/tspi_aik.c
+++ b/src/tspi/tspi_aik.c
@@ -182,8 +182,10 @@ Tspi_TPM_CollateIdentityRequest(TSS_HTPM hTPM,
/* in */
                return result;
 
        if ((result = authsess_xsap_init(tspContext, hTPM, hIdentityKey,
TSS_AUTH_POLICY_REQUIRED,
-                                        TPM_ORD_MakeIdentity, TPM_ET_OWNER,
&xsap)))
+                                        TPM_ORD_MakeIdentity, TPM_ET_OWNER,
&xsap))){
+               free(asymParms.parms);
                return result;
+       }
 
        /* Hash the Auth data */
        result = Trspi_HashInit(&hashCtx, TSS_HASH_SHA1);
@@ -392,6 +394,7 @@ Tspi_TPM_CollateIdentityRequest(TSS_HTPM hTPM,
/* in */
 error:
        authsess_free(xsap);
        free_key_refs(&caKey);
+       free(asymParms.parms);
        free(prgbIdentityBinding);
        free(prgbEndorsementCredential);
        free(prgbPlatformCredential);
--


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech

Reply via email to