Fixed memory leak.
This commit is contained in:
parent
e77a4fedc2
commit
831b74d519
@ -198,7 +198,10 @@ NTLM_CONTEXT* ntlm_ContextNew()
|
||||
char* workstation = (char*) malloc(dwSize + 1);
|
||||
|
||||
if (!workstation)
|
||||
{
|
||||
free (context);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = RegQueryValueExA(hKey, "WorkstationName", NULL, &dwType, (BYTE*) workstation, &dwSize);
|
||||
workstation[dwSize] = '\0';
|
||||
@ -206,8 +209,7 @@ NTLM_CONTEXT* ntlm_ContextNew()
|
||||
if (ntlm_SetContextWorkstation(context, workstation) < 0)
|
||||
{
|
||||
free(workstation);
|
||||
if (context)
|
||||
free(context);
|
||||
free(context);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user