Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1085)

Unified Diff: src/tspi/rpc/hosttable.c

Issue 3581012: Upgrade from trousers 0.3.3 to 0.3.6 and from testsuite 0.2 to 0.3. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/trousers.git
Patch Set: git cl push Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/tspi/ps/tspps.c ('k') | src/tspi/tsp_auth.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tspi/rpc/hosttable.c
diff --git a/src/tspi/rpc/hosttable.c b/src/tspi/rpc/hosttable.c
index 99bb276471783277976220e43465bc3cd2c484f9..f3ec2eb97e8fa6080f626fa1f59954f1d50acbf7 100644
--- a/src/tspi/rpc/hosttable.c
+++ b/src/tspi/rpc/hosttable.c
@@ -35,13 +35,17 @@ host_table_init()
return TSS_SUCCESS;
}
+#ifdef SOLARIS
+#pragma init(_init)
+void _init(void)
+#else
void __attribute__ ((constructor)) my_init(void)
+#endif
{
host_table_init();
__tspi_obj_list_init();
}
-#if 0
void
host_table_final()
{
@@ -52,6 +56,10 @@ host_table_final()
for (hte = ht->entries; hte; hte = next) {
if (hte)
next = hte->next;
+ if (hte->hostname)
+ free(hte->hostname);
+ if (hte->comm.buf)
+ free(hte->comm.buf);
free(hte);
}
@@ -61,11 +69,15 @@ host_table_final()
ht = NULL;
}
+#ifdef SOLARIS
+#pragma fini(_fini)
+void _fini(void)
+#else
void __attribute__ ((destructor)) my_fini(void)
+#endif
{
host_table_final();
}
-#endif
TSS_RESULT
__tspi_add_table_entry(TSS_HCONTEXT tspContext, BYTE *host, int type, struct host_table_entry **ret)
@@ -96,6 +108,7 @@ __tspi_add_table_entry(TSS_HCONTEXT tspContext, BYTE *host, int type, struct hos
if (tmp->tspContext == tspContext) {
LogError("Tspi_Context_Connect attempted on an already connected context!");
MUTEX_UNLOCK(ht->lock);
+ free(entry->hostname);
free(entry->comm.buf);
free(entry);
return TSPERR(TSS_E_CONNECTION_FAILED);
@@ -129,6 +142,8 @@ remove_table_entry(TSS_HCONTEXT tspContext)
prev->next = hte->next;
else
ht->entries = hte->next;
+ if (hte->hostname)
+ free(hte->hostname);
free(hte->comm.buf);
free(hte);
break;
« no previous file with comments | « src/tspi/ps/tspps.c ('k') | src/tspi/tsp_auth.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698