Commit 2a917f842e6ae9b0a0ac6dc34cf540fa7e13a644
1 parent
e67ed545
fix inconsistency in socket con/destructor
Showing
1 changed file
with
2 additions
and
1 deletions
... | ... | @@ -44,7 +44,7 @@ socketCtor(void * _this, va_list * params) |
44 | 44 | this->type = 0; |
45 | 45 | this->handle = -1; |
46 | 46 | this->log = va_arg(*params, TR_Logger); |
47 | - this->host = va_arg(*params, char*); | |
47 | + this->host = TR_strdup(va_arg(*params, char*)); | |
48 | 48 | this->port = va_arg(*params, int); |
49 | 49 | this->flags = va_arg(*params, int); |
50 | 50 | this->fin_state = TR_FIN_RDWR; |
... | ... | @@ -58,6 +58,7 @@ socketDtor(void * _this) |
58 | 58 | { |
59 | 59 | TR_Socket this = _this; |
60 | 60 | |
61 | + TR_MEM_FREE(this->host); | |
61 | 62 | TR_MEM_FREE(this->cname); |
62 | 63 | |
63 | 64 | if (STDERR_FILENO < this->handle) { | ... | ... |
Please
register
or
login
to post a comment