mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Mayaqua: fix segmentation fault, add new FreeHttpHeaderSafe() function
This commit is contained in:
parent
f32775ba47
commit
2a572aab21
@ -20645,7 +20645,7 @@ HTTP_HEADER *RecvHttpHeader(SOCK *s)
|
||||
if (AddHttpValueStr(header, str) == false)
|
||||
{
|
||||
FreeSafe(PTR_TO_PTR(str));
|
||||
FreeHttpHeader(header);
|
||||
FreeHttpHeaderSafe(&header);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -20900,6 +20900,13 @@ void FreeHttpHeader(HTTP_HEADER *header)
|
||||
Free(header);
|
||||
}
|
||||
|
||||
// Release the HTTP header and set pointer's value to NULL
|
||||
void FreeHttpHeaderSafe(HTTP_HEADER **header)
|
||||
{
|
||||
FreeHttpHeader(*header);
|
||||
*header = NULL;
|
||||
}
|
||||
|
||||
// Receive a PACK
|
||||
PACK *RecvPack(SOCK *s)
|
||||
{
|
||||
|
@ -1037,6 +1037,7 @@ HTTP_HEADER *NewHttpHeaderEx(char *method, char *target, char *version, bool no_
|
||||
int CompareHttpValue(void *p1, void *p2);
|
||||
void FreeHttpValue(HTTP_VALUE *value);
|
||||
void FreeHttpHeader(HTTP_HEADER *header);
|
||||
void FreeHttpHeaderSafe(HTTP_HEADER **header);
|
||||
|
||||
bool SendPack(SOCK *s, PACK *p);
|
||||
PACK *RecvPack(SOCK *s);
|
||||
|
Loading…
Reference in New Issue
Block a user