mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-23 01:49:53 +03:00
Mayaqua: add "PTR_TO_PTR" macro intended to be used with FreeSafe()
This commit is contained in:
parent
0cf6fac7a3
commit
e51c319648
@ -128,6 +128,7 @@
|
|||||||
#define MEMTAG_TO_POINTER(p) ((void *)(((UCHAR *)(p)) + sizeof(MEMTAG)))
|
#define MEMTAG_TO_POINTER(p) ((void *)(((UCHAR *)(p)) + sizeof(MEMTAG)))
|
||||||
#define POINTER_TO_MEMTAG(p) ((MEMTAG *)(((UCHAR *)(p)) - sizeof(MEMTAG)))
|
#define POINTER_TO_MEMTAG(p) ((MEMTAG *)(((UCHAR *)(p)) - sizeof(MEMTAG)))
|
||||||
#define IS_NULL_POINTER(p) (((p) == NULL) || ((POINTER_TO_UINT64(p) == (UINT64)sizeof(MEMTAG))))
|
#define IS_NULL_POINTER(p) (((p) == NULL) || ((POINTER_TO_UINT64(p) == (UINT64)sizeof(MEMTAG))))
|
||||||
|
#define PTR_TO_PTR(p) ((void **)(&p))
|
||||||
|
|
||||||
// Fixed size of a block of memory pool
|
// Fixed size of a block of memory pool
|
||||||
#define MEMPOOL_MAX_SIZE 3000
|
#define MEMPOOL_MAX_SIZE 3000
|
||||||
|
@ -20564,7 +20564,7 @@ HTTP_HEADER *RecvHttpHeader(SOCK *s)
|
|||||||
// Split into tokens
|
// Split into tokens
|
||||||
token = ParseToken(str, " ");
|
token = ParseToken(str, " ");
|
||||||
|
|
||||||
FreeSafe((void **)&str);
|
FreeSafe(PTR_TO_PTR(str));
|
||||||
|
|
||||||
if (token->NumTokens < 3)
|
if (token->NumTokens < 3)
|
||||||
{
|
{
|
||||||
@ -20590,18 +20590,18 @@ HTTP_HEADER *RecvHttpHeader(SOCK *s)
|
|||||||
if (IsEmptyStr(str))
|
if (IsEmptyStr(str))
|
||||||
{
|
{
|
||||||
// End of header
|
// End of header
|
||||||
FreeSafe((void **)&str);
|
FreeSafe(PTR_TO_PTR(str));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AddHttpValueStr(header, str) == false)
|
if (AddHttpValueStr(header, str) == false)
|
||||||
{
|
{
|
||||||
FreeSafe((void **)&str);
|
FreeSafe(PTR_TO_PTR(str));
|
||||||
FreeHttpHeader(header);
|
FreeHttpHeader(header);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeSafe((void **)&str);
|
FreeSafe(PTR_TO_PTR(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
return header;
|
return header;
|
||||||
|
Loading…
Reference in New Issue
Block a user