Lionel Debroux : winspool: Fix memory leak (found by Smatch).

Alexandre Julliard julliard at winehq.org
Mon Dec 17 06:42:22 CST 2007


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

Author: Lionel Debroux <lionel_debroux at yahoo.fr>
Date:   Fri Dec 14 14:56:57 2007 +0100

winspool: Fix memory leak (found by Smatch).

---

 dlls/winspool.drv/info.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 236d77d..3143429 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -611,7 +611,7 @@ PRINTCAP_ParseEntry(const char *pent, BOOL isfirst) {
     PRINTER_INFO_2A	pinfo2a;
     char		*e,*s,*name,*prettyname,*devname;
     BOOL		ret = FALSE, set_default = FALSE;
-    char                *port,*devline,*env_default;
+    char                *port = NULL, *devline,*env_default;
     HKEY                hkeyPrinter, hkeyPrinters, hkey;
 
     while (isspace(*pent)) pent++;
@@ -723,8 +723,8 @@ PRINTCAP_ParseEntry(const char *pent, BOOL isfirst) {
     if (isfirst || set_default)
         WINSPOOL_SetDefaultPrinter(devname,name,TRUE);
 
-    HeapFree(GetProcessHeap(), 0, port);
  end:
+    HeapFree(GetProcessHeap(), 0, port);
     HeapFree(GetProcessHeap(), 0, name);
     return ret;
 }




More information about the wine-cvs mailing list