forked from osmocom/wireshark
Fix Visual Studio Code Analysis warning C6011: Dereferencing NULL pointer 'returnedDevmode'
svn path=/trunk/; revision=54051
This commit is contained in:
parent
4cabb63481
commit
093ace5c24
|
@ -130,6 +130,14 @@ static HDC get_printer_dc(short *width, short *height)
|
|||
/* http://msdn.microsoft.com/en-us/library/windows/desktop/dd162931%28v=vs.85%29.aspx */
|
||||
returnedDevmode = (PDEVMODE)GlobalLock(pdlg.hDevMode);
|
||||
|
||||
if (returnedDevmode == NULL) {
|
||||
if (pdlg.hDevMode)
|
||||
GlobalFree(pdlg.hDevMode);
|
||||
if (pdlg.hDevNames)
|
||||
GlobalFree(pdlg.hDevNames);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (returnedDevmode->dmOrientation == DMORIENT_LANDSCAPE) {
|
||||
*width = returnedDevmode->dmPaperLength;
|
||||
*height = returnedDevmode->dmPaperWidth;
|
||||
|
|
Loading…
Reference in New Issue