Fix #4445: Do not call fclose on NULL file.
This commit is contained in:
parent
3c4385e1f1
commit
e36d87b55c
@ -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…
x
Reference in New Issue
Block a user