This is an automated email from the ASF dual-hosted git repository.

todd pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e2dfdae  HDFS-14482: Crash when using libhdfs with bad classpath
e2dfdae is described below

commit e2dfdaee7c23cf18bdd2a6dacc979c248407c23a
Author: Sahil Takiar <[email protected]>
AuthorDate: Mon May 13 13:29:52 2019 -0500

    HDFS-14482: Crash when using libhdfs with bad classpath
---
 .../src/main/native/libhdfs/jni_helper.c                          | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
 
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
index 405ee3f..837c7e0 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
@@ -551,6 +551,10 @@ JNIEnv* getJNIEnv(void)
     state->env = getGlobalJNIEnv();
     mutexUnlock(&jvmMutex);
 
+    if (!state->env) {
+        goto fail;
+    }
+
     jthrowable jthr = NULL;
     jthr = initCachedClasses(state->env);
     if (jthr) {
@@ -558,10 +562,6 @@ JNIEnv* getJNIEnv(void)
                             "initCachedClasses failed");
       goto fail;
     }
-
-    if (!state->env) {
-      goto fail;
-    }
     return state->env;
 
 fail:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to