From: Kent Y. <ky...@us...> - 2012-08-16 15:58:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Trousers". The branch, master has been updated via aae44bf27aec79b253ace3115648bd90b78ddb51 (commit) from 5581e378c65a0db9a288ffef64f04e48adae4e2b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://trousers.git.sourceforge.net/git/gitweb.cgi?p=trousers/trousers;a=commitdiff;h=aae44bf27aec79b253ace3115648bd90b78ddb51 commit aae44bf27aec79b253ace3115648bd90b78ddb51 Author: Andreas Steffen <and...@st...> Date: Thu Aug 16 10:57:07 2012 -0500 tspi: Fix various memory leaks in PCR composite object use SF Bug: 3541972 Signed-off-by: Andreas Steffen <and...@st...> Signed-off-by: Kent Yoder <ke...@li...> diff --git a/src/tspi/obj_pcrs.c b/src/tspi/obj_pcrs.c index 5408302..c36b761 100644 --- a/src/tspi/obj_pcrs.c +++ b/src/tspi/obj_pcrs.c @@ -71,9 +71,11 @@ pcrs_free(void *data) switch (pcrs->type) { case TSS_PCRS_STRUCT_INFO: free(pcrs->info.info11.pcrSelection.pcrSelect); + free(pcrs->pcrs); break; case TSS_PCRS_STRUCT_INFO_SHORT: free(pcrs->info.infoshort.pcrSelection.pcrSelect); + free(pcrs->pcrs); break; case TSS_PCRS_STRUCT_INFO_LONG: free(pcrs->info.infolong.creationPCRSelection.pcrSelect); diff --git a/src/tspi/tspi_quote.c b/src/tspi/tspi_quote.c index 58d5de0..4615ece 100644 --- a/src/tspi/tspi_quote.c +++ b/src/tspi/tspi_quote.c @@ -125,18 +125,26 @@ Tspi_TPM_Quote(TSS_HTPM hTPM, /* in */ if (hPcrComposite) { TCPA_PCR_COMPOSITE pcrComp; + memset(&pcrComp, 0, sizeof(pcrComp)); offset = 0; if ((result = Trspi_UnloadBlob_PCR_COMPOSITE(&offset, pcrDataOut, &pcrComp))) { free(pcrDataOut); + free(pcrComp.pcrValue); + free(pcrComp.select.pcrSelect); free(validationData); return result; } if ((result = obj_pcrs_set_values(hPcrComposite, &pcrComp))) { free(pcrDataOut); + free(pcrComp.pcrValue); + free(pcrComp.select.pcrSelect); free(validationData); return result; } + + free(pcrComp.pcrValue); + free(pcrComp.select.pcrSelect); } if ((result = Tspi_GetAttribData(hIdentKey, TSS_TSPATTRIB_KEY_BLOB, diff --git a/src/tspi/tspi_quote2.c b/src/tspi/tspi_quote2.c index 0283ab6..584f097 100644 --- a/src/tspi/tspi_quote2.c +++ b/src/tspi/tspi_quote2.c @@ -163,11 +163,13 @@ Tspi_TPM_Quote2(TSS_HTPM hTPM, // in offset = 0; if ((result = Trspi_UnloadBlob_PCR_INFO_SHORT(&offset, pcrDataOut, &pcrInfo))) { free(pcrDataOut); + free(pcrInfo.pcrSelection.pcrSelect); if (*versionInfoSize > 0) free(*versionInfo); free(sig); return result; } + free(pcrInfo.pcrSelection.pcrSelect); /* Set both digestAtRelease and localityAtRelease */ if ((result = obj_pcrs_set_locality(hPcrComposite, pcrInfo.localityAtRelease))) { ----------------------------------------------------------------------- Summary of changes: src/tspi/obj_pcrs.c | 2 ++ src/tspi/tspi_quote.c | 8 ++++++++ src/tspi/tspi_quote2.c | 2 ++ 3 files changed, 12 insertions(+), 0 deletions(-) hooks/post-receive -- Trousers |