From 42f791ccd561f9188109dd000940536849919f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Tue, 30 Oct 2012 20:07:15 +0100 Subject: [PATCH] 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 037ea342d1f..f984225f9bd 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 b6bbe7a1ab6..35a55f0a13f 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; }