1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-08 08:44:57 +03:00

Mayaqua: add new FreeSafe() function which calls Free() and set the pointer's value to NULL

This commit is contained in:
Davide Beatrici
2018-12-20 02:52:22 +01:00
parent ada06e218e
commit bd01cbff9a
3 changed files with 12 additions and 4 deletions

View File

@ -20564,7 +20564,7 @@ HTTP_HEADER *RecvHttpHeader(SOCK *s)
// Split into tokens
token = ParseToken(str, " ");
Free(str);
FreeSafe((void **)&str);
if (token->NumTokens < 3)
{
@ -20590,18 +20590,18 @@ HTTP_HEADER *RecvHttpHeader(SOCK *s)
if (IsEmptyStr(str))
{
// End of header
Free(str);
FreeSafe((void **)&str);
break;
}
if (AddHttpValueStr(header, str) == false)
{
Free(str);
FreeSafe((void **)&str);
FreeHttpHeader(header);
break;
}
Free(str);
FreeSafe((void **)&str);
}
return header;