1
0
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:
Davide Beatrici 2018-12-30 15:00:21 +01:00 committed by GitHub
commit 422076d6c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);