Socket creation should use C++ new.
It wasn't.
This commit is contained in:
+3
-3
@@ -168,11 +168,11 @@ void a_Http_set_proxy_passwd(const char *str)
|
|||||||
* Create and init a new SocketData_t struct, insert into ValidSocks,
|
* Create and init a new SocketData_t struct, insert into ValidSocks,
|
||||||
* and return a primary key for it.
|
* and return a primary key for it.
|
||||||
*/
|
*/
|
||||||
static int Http_sock_new(void)
|
static int Http_sock_new()
|
||||||
{
|
{
|
||||||
SocketData_t *S = dNew0(SocketData_t, 1);
|
auto S = std::make_unique< SocketData_t >();
|
||||||
S->SockFD = -1;
|
S->SockFD = -1;
|
||||||
return a_Klist_insert(&ValidSocks, S);
|
return a_Klist_insert(&ValidSocks, S.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user