Commit 2d759f71 by Tom Tromey Committed by Tom Tromey

jni.cc (_Jv_JNI_AttachCurrentThread): Return error if malloc fails.

	* jni.cc (_Jv_JNI_AttachCurrentThread): Return error if malloc
	fails.

From-SVN: r31986
parent fa545500
2000-02-15 Tom Tromey <tromey@cygnus.com>
* jni.cc (_Jv_JNI_AttachCurrentThread): Return error if malloc
fails.
2000-02-15 Bryce McKinlay <bryce@albatross.co.nz>
* NEWS: Updated.
......
......@@ -1415,16 +1415,21 @@ _Jv_JNI_AttachCurrentThread (JavaVM *, jstring name, void **penv, void *args)
if (_Jv_ThreadCurrent () != NULL)
return 0;
// FIXME: NULL return?
JNIEnv *env = (JNIEnv *) _Jv_MallocUnchecked (sizeof (JNIEnv));
if (env == NULL)
return JNI_ERR;
env->p = &_Jv_JNIFunctions;
env->ex = NULL;
env->klass = NULL;
// FIXME: NULL return?
env->locals
= (_Jv_JNI_LocalFrame *) _Jv_MallocUnchecked (sizeof (_Jv_JNI_LocalFrame)
+ (FRAME_SIZE
* sizeof (jobject)));
if (env->locals == NULL)
{
_Jv_Free (env);
return JNI_ERR;
}
*penv = reinterpret_cast<void *> (env);
java::lang::Thread *t = new gnu::gcj::jni::NativeThread (group, name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment