Mutex lock is not held when calling lead_class() so we should not
try to unlock it when the call fails.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 vm/classloader.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/vm/classloader.c b/vm/classloader.c
index a0add9d..3f436af 100644
--- a/vm/classloader.c
+++ b/vm/classloader.c
@@ -467,7 +467,7 @@ struct vm_class *classloader_load(const char *class_name)
                                          &classloader_mutex);
 
                vmc = classes[class_index].class;
-               goto out;
+               goto out_unlock;
        }
 
        /*
@@ -482,7 +482,7 @@ struct vm_class *classloader_load(const char *class_name)
                if (!new_array) {
                        NOT_IMPLEMENTED;
                        vmc = NULL;
-                       goto out;
+                       goto out_unlock;
                }
 
                max_classes = new_max_classes;
@@ -517,8 +517,10 @@ struct vm_class *classloader_load(const char *class_name)
         * be worth to use a per-class condition variable for that? */
        pthread_cond_broadcast(&classloader_cond);
 
-out:
+ out_unlock:
        pthread_mutex_unlock(&classloader_mutex);
+
+ out:
        trace_pop();
        return vmc;
 }
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to