=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: wineps: Avoid memory leaks (coverity ).

Alexandre Julliard julliard at winehq.org
Wed Oct 31 17:17:21 CDT 2012


Module: wine
Branch: master
Commit: 42f791ccd561f9188109dd000940536849919f53
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=42f791ccd561f9188109dd000940536849919f53

Author: André Hentschel <nerv at dawncrow.de>
Date:   Tue Oct 30 20:07:15 2012 +0100

wineps: Avoid memory leaks (coverity).

---

 dlls/wineps.drv/download.c |    7 ++++---
 dlls/wineps.drv/ps.c       |    1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/wineps.drv/download.c b/dlls/wineps.drv/download.c
index 037ea34..f984225 100644
--- a/dlls/wineps.drv/download.c
+++ b/dlls/wineps.drv/download.c
@@ -313,9 +313,10 @@ BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev)
         UINT emsize;
 
         if (!get_bbox(dev->hdc, &bbox, &emsize)) {
-	    HeapFree(GetProcessHeap(), 0, potm);
-	    return FALSE;
-	}
+            HeapFree(GetProcessHeap(), 0, ps_name);
+            HeapFree(GetProcessHeap(), 0, potm);
+            return FALSE;
+        }
         if(!is_room_for_font(physDev))
             PSDRV_EmptyDownloadList(dev, TRUE);
 
diff --git a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c
index b6bbe7a..35a55f0 100644
--- a/dlls/wineps.drv/ps.c
+++ b/dlls/wineps.drv/ps.c
@@ -385,6 +385,7 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
                      strlen(escaped_title) + 30 );
     if(!buf) {
         WARN("HeapAlloc failed\n");
+        HeapFree(GetProcessHeap(), 0, escaped_title);
         return 0;
     }
 




More information about the wine-cvs mailing list