Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1ca74357
Commit
1ca74357
authored
Sep 14, 2007
by
Andrew Talbot
Committed by
Alexandre Julliard
Sep 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Fix some memory leaks.
parent
4ccd78c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
printdlg.c
dlls/comdlg32/printdlg.c
+12
-2
printdlg16.c
dlls/comdlg32/printdlg16.c
+5
-4
No files found.
dlls/comdlg32/printdlg.c
View file @
1ca74357
...
...
@@ -2059,7 +2059,10 @@ BOOL WINAPI PrintDlgA(LPPRINTDLGA lppd)
GetPrinterDriverA
(
hprn
,
NULL
,
3
,
NULL
,
0
,
&
needed
);
dbuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
needed
);
if
(
!
GetPrinterDriverA
(
hprn
,
NULL
,
3
,
(
LPBYTE
)
dbuf
,
needed
,
&
needed
))
{
ERR
(
"GetPrinterDriverA failed, le %d, fix your config for printer %s!
\n
"
,
GetLastError
(),
pbuf
->
pPrinterName
);
ERR
(
"GetPrinterDriverA failed, le %d, fix your config for printer %s!
\n
"
,
GetLastError
(),
pbuf
->
pPrinterName
);
HeapFree
(
GetProcessHeap
(),
0
,
dbuf
);
HeapFree
(
GetProcessHeap
(),
0
,
pbuf
);
COMDLG32_SetCommDlgExtendedError
(
PDERR_RETDEFFAILURE
);
return
FALSE
;
}
...
...
@@ -2206,7 +2209,10 @@ BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
GetPrinterDriverW
(
hprn
,
NULL
,
3
,
NULL
,
0
,
&
needed
);
dbuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
needed
);
if
(
!
GetPrinterDriverW
(
hprn
,
NULL
,
3
,
(
LPBYTE
)
dbuf
,
needed
,
&
needed
))
{
ERR
(
"GetPrinterDriverA failed, le %d, fix your config for printer %s!
\n
"
,
GetLastError
(),
debugstr_w
(
pbuf
->
pPrinterName
));
ERR
(
"GetPrinterDriverA failed, le %d, fix your config for printer %s!
\n
"
,
GetLastError
(),
debugstr_w
(
pbuf
->
pPrinterName
));
HeapFree
(
GetProcessHeap
(),
0
,
dbuf
);
HeapFree
(
GetProcessHeap
(),
0
,
pbuf
);
COMDLG32_SetCommDlgExtendedError
(
PDERR_RETDEFFAILURE
);
return
FALSE
;
}
...
...
@@ -2615,6 +2621,8 @@ PRINTDLG_PS_ChangeActivePrinterA(LPSTR name, PageSetupDataA *pda){
lpDriverInfo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
needed
);
if
(
!
GetPrinterDriverA
(
hprn
,
NULL
,
3
,
(
LPBYTE
)
lpDriverInfo
,
needed
,
&
needed
))
{
ERR
(
"GetPrinterDriverA failed for %s, fix your config!
\n
"
,
lpPrinterInfo
->
pPrinterName
);
HeapFree
(
GetProcessHeap
(),
0
,
lpDriverInfo
);
HeapFree
(
GetProcessHeap
(),
0
,
lpPrinterInfo
);
return
FALSE
;
}
ClosePrinter
(
hprn
);
...
...
@@ -2622,6 +2630,8 @@ PRINTDLG_PS_ChangeActivePrinterA(LPSTR name, PageSetupDataA *pda){
needed
=
DocumentPropertiesA
(
0
,
0
,
name
,
NULL
,
NULL
,
0
);
if
(
needed
==
-
1
)
{
ERR
(
"DocumentProperties fails on %s
\n
"
,
debugstr_a
(
name
));
HeapFree
(
GetProcessHeap
(),
0
,
lpDriverInfo
);
HeapFree
(
GetProcessHeap
(),
0
,
lpPrinterInfo
);
return
FALSE
;
}
pDevMode
=
HeapAlloc
(
GetProcessHeap
(),
0
,
needed
);
...
...
dlls/comdlg32/printdlg16.c
View file @
1ca74357
...
...
@@ -390,9 +390,10 @@ BOOL16 WINAPI PrintDlg16(
GetPrinterDriverA
(
hprn
,
NULL
,
3
,
NULL
,
0
,
&
needed
);
dbuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
needed
);
if
(
!
GetPrinterDriverA
(
hprn
,
NULL
,
3
,
(
LPBYTE
)
dbuf
,
needed
,
&
needed
))
{
ERR
(
"GetPrinterDriverA failed for %s, le %d, fix your config!
\n
"
,
pbuf
->
pPrinterName
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
dbuf
);
ERR
(
"GetPrinterDriverA failed for %s, le %d, fix your config!
\n
"
,
pbuf
->
pPrinterName
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
dbuf
);
HeapFree
(
GetProcessHeap
(),
0
,
pbuf
);
COMDLG32_SetCommDlgExtendedError
(
PDERR_RETDEFFAILURE
);
return
FALSE
;
}
...
...
@@ -506,7 +507,7 @@ BOOL16 WINAPI PrintDlg16(
HeapFree
(
GetProcessHeap
(),
0
,
PrintStructures
->
lpDevMode
);
HeapFree
(
GetProcessHeap
(),
0
,
PrintStructures
->
lpPrinterInfo
);
HeapFree
(
GetProcessHeap
(),
0
,
PrintStructures
->
lpDriverInfo
);
HeapFree
(
GetProcessHeap
(),
0
,
PrintStructures
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr16
);
}
if
(
bRet
&&
(
lppd
->
Flags
&
PD_RETURNDC
||
lppd
->
Flags
&
PD_RETURNIC
))
bRet
=
PRINTDLG_CreateDC16
(
lppd
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment