1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

Mayaqua: fix segmentation fault, add new FreeHttpHeaderSafe() function

This commit is contained in:
Davide Beatrici 2018-12-30 14:46:26 +01:00
parent f32775ba47
commit 2a572aab21
2 changed files with 9 additions and 1 deletions

View File

@ -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)
{

View File

@ -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);