From: Armin Novak Date: Fri, 16 Feb 2018 07:57:05 +0000 (+0100) Subject: Fix #4445: Do not call fclose on NULL file. X-Git-Tag: 2.0.0-rc2~44^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e36d87b55c4822676831338cdffe7e9d4119f6b5;p=platform%2Fupstream%2Ffreerdp.git Fix #4445: Do not call fclose on NULL file. --- diff --git a/winpr/libwinpr/utils/sam.c b/winpr/libwinpr/utils/sam.c index 2065317..04e06f9 100644 --- a/winpr/libwinpr/utils/sam.c +++ b/winpr/libwinpr/utils/sam.c @@ -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; }