mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
client: use lws_strdup for client_hostname_copy
https://github.com/warmcat/libwebsockets/issues/1343
This commit is contained in:
parent
264583fe7d
commit
9a1462d221
2 changed files with 5 additions and 2 deletions
|
@ -1597,6 +1597,9 @@ void lws_free(void *p);
|
|||
#define lws_free_set_NULL(P) do { lws_realloc(P, 0, "free"); (P) = NULL; } while(0)
|
||||
#endif
|
||||
|
||||
char *
|
||||
lws_strdup(const char *s);
|
||||
|
||||
int
|
||||
lws_plat_pipe_create(struct lws *wsi);
|
||||
int
|
||||
|
|
|
@ -162,7 +162,7 @@ create_new_conn:
|
|||
|
||||
if (!wsi->client_hostname_copy)
|
||||
wsi->client_hostname_copy =
|
||||
strdup(lws_hdr_simple_ptr(wsi,
|
||||
lws_strdup(lws_hdr_simple_ptr(wsi,
|
||||
_WSI_TOKEN_CLIENT_PEER_ADDRESS));
|
||||
|
||||
/*
|
||||
|
@ -846,7 +846,7 @@ html_parser_cb(const hubbub_token *token, void *pw)
|
|||
|
||||
#endif
|
||||
|
||||
static char *
|
||||
char *
|
||||
lws_strdup(const char *s)
|
||||
{
|
||||
char *d = lws_malloc(strlen(s) + 1, "strdup");
|
||||
|
|
Loading…
Add table
Reference in a new issue