Menu

#181 Error calling Tspi_Context_Close with remote connection enabled

Bug
closed-works-for-me
None
3
2014-11-03
2014-08-17
No

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.

1 Attachments

Discussion

  • Hon Ching(Vicky) Lo

    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

     
  • Hon Ching(Vicky) Lo

    • status: open --> closed-works-for-me
    • assigned_to: Hon Ching(Vicky) Lo
     

Log in to post a comment.