Skip to content

Commit

Permalink
add null check of hack_free
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Jan 23, 2016
1 parent 8babff7 commit f1b510c
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 29 deletions.
2 changes: 1 addition & 1 deletion XScreenSaverWin.iss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{B7914227-CD94-4B6F-859C-E3823C9552DA}
AppName=XScreenSaver for Windows
AppVerName=XScreenSaver for Windows v0.77
AppVerName=XScreenSaver for Windows v0.78
AppPublisher=Katayama Hirofumi MZ
AppPublisherURL=http://katahiromz.web.fc2.com/xscreensaverwin/eindex.html
AppSupportURL=http://katahiromz.web.fc2.com/xscreensaverwin/eindex.html
Expand Down
8 changes: 4 additions & 4 deletions debughelper/debughelper.rc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Version Info

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 7, 7, 0
PRODUCTVERSION 0, 7, 7, 0
FILEVERSION 0, 7, 8, 0
PRODUCTVERSION 0, 7, 8, 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
Expand All @@ -33,10 +33,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Katayama Hirofumi MZ\0"
VALUE "FileDescription", "XScreenSaverWin debughelper\0"
VALUE "FileVersion", "0.77\0"
VALUE "FileVersion", "0.78\0"
VALUE "LegalCopyright", "Copyright (C) 2015 Katayama Hirofumi MZ.\0"
VALUE "ProductName", "XScreenSaverWin\0"
VALUE "ProductVersion", "0.77\0"
VALUE "ProductVersion", "0.78\0"
END
END
BLOCK "VarFileInfo"
Expand Down
5 changes: 4 additions & 1 deletion non-wgl/non-wgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ void ss_term(void)
free(ss.modeinfo.colors);
free(ss.modeinfo.pixels);
XFreeGC(ss.modeinfo.dpy, ss.modeinfo.gc);
hack_free(&ss.modeinfo);
if (hack_free != NULL)
{
hack_free(&ss.modeinfo);
}
ReleaseDC(ss.hwnd, ss.hdc);
DeleteObject(ss.hbmScreenShot);
CloseHandle(g_hMapping);
Expand Down
8 changes: 4 additions & 4 deletions random/random.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Version Info

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 7, 7, 0
PRODUCTVERSION 0, 7, 7, 0
FILEVERSION 0, 7, 8, 0
PRODUCTVERSION 0, 7, 8, 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
Expand All @@ -21,10 +21,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Katayama Hirofumi MZ\0"
VALUE "FileDescription", "XScreenSaverWin random screensaver\0"
VALUE "FileVersion", "0.77\0"
VALUE "FileVersion", "0.78\0"
VALUE "LegalCopyright", "Copyright (C) 2015 Katayama Hirofumi MZ.\0"
VALUE "ProductName", "XScreenSaverWin\0"
VALUE "ProductVersion", "0.77\0"
VALUE "ProductVersion", "0.78\0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions screenhack.rc
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ FONT 8, "Arial"
// Version Info

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 7, 7, 0
PRODUCTVERSION 0, 7, 7, 0
FILEVERSION 0, 7, 8, 0
PRODUCTVERSION 0, 7, 8, 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
Expand All @@ -91,10 +91,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Katayama Hirofumi MZ\0"
VALUE "FileDescription", "XScreenSaverWin screenhack\0"
VALUE "FileVersion", "0.77\0"
VALUE "FileVersion", "0.78\0"
VALUE "LegalCopyright", "Copyright (C) 2015 Katayama Hirofumi MZ.\0"
VALUE "ProductName", "XScreenSaverWin\0"
VALUE "ProductVersion", "0.77\0"
VALUE "ProductVersion", "0.78\0"
END
END
BLOCK "VarFileInfo"
Expand Down
5 changes: 4 additions & 1 deletion wgl/wgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ void ss_term(void)
{
free(ss.modeinfo.colors);
free(ss.modeinfo.pixels);
hack_free(&ss.modeinfo);
if (hack_free != NULL)
{
hack_free(&ss.modeinfo);
}
ReleaseDC(ss.hwnd, ss.hdc);
DeleteObject(ss.hbmScreenShot);
CloseHandle(g_hMapping);
Expand Down
8 changes: 4 additions & 4 deletions xlockmore.rc
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ FONT 8, "Arial"
// Version Info

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 7, 7, 0
PRODUCTVERSION 0, 7, 7, 0
FILEVERSION 0, 7, 8, 0
PRODUCTVERSION 0, 7, 8, 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
Expand All @@ -91,10 +91,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Katayama Hirofumi MZ\0"
VALUE "FileDescription", "XScreenSaverWin xlockmore\0"
VALUE "FileVersion", "0.77\0"
VALUE "FileVersion", "0.78\0"
VALUE "LegalCopyright", "Copyright (C) 2015 Katayama Hirofumi MZ.\0"
VALUE "ProductName", "XScreenSaverWin\0"
VALUE "ProductVersion", "0.77\0"
VALUE "ProductVersion", "0.78\0"
END
END
BLOCK "VarFileInfo"
Expand Down
2 changes: 1 addition & 1 deletion xscreensaver-text/xscreensaver-text.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const char *saver_key = "Software\\Katayama Hirofumi MZ\\%s";

void show_version(void)
{
fprintf(stderr, "XScreenSaver for Windows v0.77 text client utility\n");
fprintf(stderr, "XScreenSaver for Windows v0.78 text client utility\n");
fprintf(stderr, "Written by Katayama Hirofumi MZ\n");
}

Expand Down
8 changes: 4 additions & 4 deletions xscreensaver-text/xscreensaver-text.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Version Info

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 7, 7, 0
PRODUCTVERSION 0, 7, 7, 0
FILEVERSION 0, 7, 8, 0
PRODUCTVERSION 0, 7, 8, 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
Expand All @@ -21,10 +21,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Katayama Hirofumi MZ\0"
VALUE "FileDescription", "XScreenSaverWin text\0"
VALUE "FileVersion", "0.77\0"
VALUE "FileVersion", "0.78\0"
VALUE "LegalCopyright", "Copyright (C) 2015 Katayama Hirofumi MZ.\0"
VALUE "ProductName", "XScreenSaverWin\0"
VALUE "ProductVersion", "0.77\0"
VALUE "ProductVersion", "0.78\0"
END
END
BLOCK "VarFileInfo"
Expand Down
10 changes: 5 additions & 5 deletions xscreensaver/xscreensaver.rc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Version Info

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0, 7, 7, 0
PRODUCTVERSION 0, 7, 7, 0
FILEVERSION 0, 7, 8, 0
PRODUCTVERSION 0, 7, 8, 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
Expand All @@ -28,10 +28,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Katayama Hirofumi MZ\0"
VALUE "FileDescription", "XScreenSaverWin\0"
VALUE "FileVersion", "0.77\0"
VALUE "FileVersion", "0.78\0"
VALUE "LegalCopyright", "Copyright (C) 2015 Katayama Hirofumi MZ.\0"
VALUE "ProductName", "XScreenSaverWin\0"
VALUE "ProductVersion", "0.77\0"
VALUE "ProductVersion", "0.78\0"
END
END
BLOCK "VarFileInfo"
Expand All @@ -56,7 +56,7 @@ END

1 DIALOGEX 0, 0, 215, 180
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "XScreenSaver for Windows v0.77"
CAPTION "XScreenSaver for Windows v0.78"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 9, "Arial"
{
Expand Down

0 comments on commit f1b510c

Please sign in to comment.