harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r814565 - /harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
Date Mon, 14 Sep 2009 10:30:01 GMT
Author: hindessm
Date: Mon Sep 14 10:30:01 2009
New Revision: 814565

URL: http://svn.apache.org/viewvc?rev=814565&view=rev
Log:
Remove result variable that already exists in this scope.
Keep original pointer for alloc'd memory so we can free it correctly.

Modified:
    harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp?rev=814565&r1=814564&r2=814565&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
(original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
Mon Sep 14 10:30:01 2009
@@ -77,8 +77,8 @@
             bool result =  MatchPatternSourceName(sourceFileName, m_pattern);
 
             if(!result) {
-                bool result;
-                char *p = (char*) GetMemoryManager().Allocate(strlen(m_pattern)+1 JDWP_FILE_LINE);
+                char *p_orig = (char*) GetMemoryManager().Allocate(strlen(m_pattern)+1 JDWP_FILE_LINE);
+                char *p = p_orig;
                 strcpy(p, m_pattern);
                 // replace '.' with '/' to be matched with signature
                 for (; *p != '\0'; p++) {
@@ -88,7 +88,7 @@
                 }
                 JDWP_ASSERT(eInfo.signature != 0);
                 result = MatchPattern(eInfo.signature, p);
-                GetMemoryManager().Free(p JDWP_FILE_LINE);
+                GetMemoryManager().Free(p_orig JDWP_FILE_LINE);
                 return result;
             } else {
                 return true;



Mime
View raw message