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,7 +44,7 @@ socketCtor(void * _this, va_list * params) | ||
44 | this->type = 0; | 44 | this->type = 0; |
45 | this->handle = -1; | 45 | this->handle = -1; |
46 | this->log = va_arg(*params, TR_Logger); | 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 | this->port = va_arg(*params, int); | 48 | this->port = va_arg(*params, int); |
49 | this->flags = va_arg(*params, int); | 49 | this->flags = va_arg(*params, int); |
50 | this->fin_state = TR_FIN_RDWR; | 50 | this->fin_state = TR_FIN_RDWR; |
@@ -58,6 +58,7 @@ socketDtor(void * _this) | @@ -58,6 +58,7 @@ socketDtor(void * _this) | ||
58 | { | 58 | { |
59 | TR_Socket this = _this; | 59 | TR_Socket this = _this; |
60 | 60 | ||
61 | + TR_MEM_FREE(this->host); | ||
61 | TR_MEM_FREE(this->cname); | 62 | TR_MEM_FREE(this->cname); |
62 | 63 | ||
63 | if (STDERR_FILENO < this->handle) { | 64 | if (STDERR_FILENO < this->handle) { |
Please
register
or
login
to post a comment