Andrew Talbot : winedbg: Fix a memory leak.

Alexandre Julliard julliard at winehq.org
Wed Oct 24 11:04:52 CDT 2007


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

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Tue Oct 23 18:06:30 2007 +0100

winedbg: Fix a memory leak.

---

 programs/winedbg/source.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/winedbg/source.c b/programs/winedbg/source.c
index c1fb2eb..eb9576d 100644
--- a/programs/winedbg/source.c
+++ b/programs/winedbg/source.c
@@ -70,9 +70,9 @@ void source_add_path(const char* path)
     size = strlen(path) + 1;
     if (search_path)
     {
-        unsigned pos = HeapSize(GetProcessHeap(), 0, search_path);
+        unsigned pos = strlen(search_path) + 1;
         new = HeapReAlloc(GetProcessHeap(), 0, search_path, pos + size);
-        if (!new || !pos) return;
+        if (!new) return;
         new[pos - 1] = ';';
         strcpy(&new[pos], path);
     }




More information about the wine-cvs mailing list