diff --git a/src/stdfn.c b/src/stdfn.c index 73329c5c..8dc64898 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -634,8 +634,10 @@ BOOL IsFontAvailable(const char* font_name) { LOGFONTA lf = { 0 }; HDC hDC = GetDC(hMainDialog); - if (font_name == NULL) + if (font_name == NULL) { + ReleaseDC(hMainDialog, hDC); return FALSE; + } lf.lfCharSet = DEFAULT_CHARSET; safe_strcpy(lf.lfFaceName, LF_FACESIZE, font_name);