mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
fix V773 from PSV-Studio
The function was exited without releasing the 'hDC' handle. A resource leak is possible.
This commit is contained in:
parent
6a45a678b3
commit
2237854992
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue