Fixed the problem of the function Tspi_Context_Close when is enabled remote connection uncommenting the remote_ops in the file tcsd.conf.
All the time that this function is called, it was returning:
double free or corruption (fasttop): 0x0000000001487af0
Aborted (core dumped)
The functions RPC_OpenContext and obj_context_set_machine_name in Tspi_Context_Connect were receiving the same memory address from the variable machine_name. With that, when Tspi_Context_Close called obj_close_context, this function called the function free passing as argument the variable machineName that had the same memory address from that one pointed by RPC_OpenContext.
However remove_table_entry in RPC_CloseContext had already called the function free to that memory address. The result is the error message described above.
Hi Anderson,
The patch looks good. I would add another line "free(entry);" to the
src/tspi/rpc/hosttable.c as below:
+
+ hostlen = strlen((char )host)+1;
+ entry->hostname = (BYTE )calloc(1, hostlen);
+ if (entry->hostname == NULL) {
+ LogError("malloc of %u bytes failed.", hostlen);
+ free(entry);
+ return TSPERR(TSS_E_OUTOFMEMORY);
+ }
Thanks,
Vicky