fixed memory leak in TPM Version Info
authorAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 13 Dec 2012 10:10:24 +0000 (11:10 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 13 Dec 2012 10:10:38 +0000 (11:10 +0100)
src/libpts/pts/pts.c

index 509fc41..ec5ac1e 100644 (file)
@@ -310,12 +310,15 @@ static void print_tpm_version_info(private_pts_t *this)
        else
        {
                DBG2(DBG_PTS, "TPM 1.2 Version Info: Chip Version: %hhu.%hhu.%hhu.%hhu,"
-                                         " Spec Level: %hu, Errata Rev: %hhu, Vendor ID: %.4s",
+                                         " Spec Level: %hu, Errata Rev: %hhu, Vendor ID: %.4s [%.*s]",
                                          versionInfo.version.major, versionInfo.version.minor,
                                          versionInfo.version.revMajor, versionInfo.version.revMinor,
                                          versionInfo.specLevel, versionInfo.errataRev,
-                                         versionInfo.tpmVendorID);
+                                         versionInfo.tpmVendorID, versionInfo.vendorSpecificSize,
+                                         versionInfo.vendorSpecificSize ?
+                                         (char*)versionInfo.vendorSpecific : "");
        }
+       free(versionInfo.vendorSpecific);
 }
 
 #else