Merge pull request #4446 from akallabeth/sam_crash_fix
Fix #3335: Do not call fclose on NULL file.
This commit is contained in:
commit
420f34f63a
@ -52,9 +52,7 @@ WINPR_SAM* SamOpen(const char* filename, BOOL readOnly)
|
||||
filename = WINPR_SAM_FILE;
|
||||
|
||||
if (readOnly)
|
||||
{
|
||||
fp = fopen(filename, "r");
|
||||
}
|
||||
else
|
||||
{
|
||||
fp = fopen(filename, "r+");
|
||||
@ -79,8 +77,6 @@ WINPR_SAM* SamOpen(const char* filename, BOOL readOnly)
|
||||
else
|
||||
{
|
||||
WLog_DBG(TAG, "Could not open SAM file!");
|
||||
fclose(fp);
|
||||
free(sam);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user