harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r694234 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c
Date Thu, 11 Sep 2008 12:59:30 GMT
Author: odeakin
Date: Thu Sep 11 05:59:29 2008
New Revision: 694234

URL: http://svn.apache.org/viewvc?rev=694234&view=rev
Log:
Fix errors from HARMONY-5976 ([classlib] Results of static analysis):
 - Fix potential infinite loop.
 - Check for NULL pointer return from memory allocation.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c?rev=694234&r1=694233&r2=694234&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c Thu Sep
11 05:59:29 2008
@@ -250,6 +250,7 @@
 			cursor->vmLocalStorage[((UDATA) *pKey) - 1] = value;
 			return value;
 		}
+        cursor = cursor->linkNext;
 	}
 
 	return value;
@@ -300,10 +301,10 @@
 
 		/* Allocate a new container */
 		container = hymem_allocate_memory(sizeof(VMLSContainer));
-		if (container) {
-			memset(container,0,sizeof(VMLSContainer));
-			container->javaVM = vm;
-		}
+		if (!container) return;
+
+        memset(container,0,sizeof(VMLSContainer));
+		container->javaVM = vm;
 
 		/* Insert it into the list */
 		container->linkNext = vmls->containerHead;



Mime
View raw message