mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-26 03:19:52 +03:00
Merge PR #851: Mayaqua: fix segmentation fault, add new FreeHttpHeaderSafe() function
This commit is contained in:
commit
422076d6c9
@ -20645,7 +20645,7 @@ HTTP_HEADER *RecvHttpHeader(SOCK *s)
|
|||||||
if (AddHttpValueStr(header, str) == false)
|
if (AddHttpValueStr(header, str) == false)
|
||||||
{
|
{
|
||||||
FreeSafe(PTR_TO_PTR(str));
|
FreeSafe(PTR_TO_PTR(str));
|
||||||
FreeHttpHeader(header);
|
FreeHttpHeaderSafe(&header);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20900,6 +20900,13 @@ void FreeHttpHeader(HTTP_HEADER *header)
|
|||||||
Free(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
|
// Receive a PACK
|
||||||
PACK *RecvPack(SOCK *s)
|
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);
|
int CompareHttpValue(void *p1, void *p2);
|
||||||
void FreeHttpValue(HTTP_VALUE *value);
|
void FreeHttpValue(HTTP_VALUE *value);
|
||||||
void FreeHttpHeader(HTTP_HEADER *header);
|
void FreeHttpHeader(HTTP_HEADER *header);
|
||||||
|
void FreeHttpHeaderSafe(HTTP_HEADER **header);
|
||||||
|
|
||||||
bool SendPack(SOCK *s, PACK *p);
|
bool SendPack(SOCK *s, PACK *p);
|
||||||
PACK *RecvPack(SOCK *s);
|
PACK *RecvPack(SOCK *s);
|
||||||
|
Loading…
Reference in New Issue
Block a user