diff -ruN newt-0.52.2-old/label.c newt-0.52.2/label.c
--- newt-0.52.2-old/label.c	2006-09-29 15:16:18.000000000 +0100
+++ newt-0.52.2/label.c	2006-09-29 15:19:29.000000000 +0100
@@ -36,6 +36,7 @@
     co->top = top;
     co->left = left;
     co->takesFocus = 0;
+    co->isMapped = 0;
 
     la->length = strlen(text);
     la->text = strdup(text);
@@ -78,6 +79,8 @@
     struct label * la = co->data;
 
     free(la->text);
+    la->text = NULL;
     free(la);
+    co->data = NULL;
     free(co);
 }
diff -ruN newt-0.52.2-old/newt.c newt-0.52.2/newt.c
--- newt-0.52.2-old/newt.c	2006-09-29 15:16:18.000000000 +0100
+++ newt-0.52.2/newt.c	2006-09-29 15:22:51.000000000 +0100
@@ -248,24 +248,34 @@
 {
     FriBidiChar *out = NULL;
     static void *handle = NULL;
+    static int skip_out = 0;
 
     fribidi_boolean (*func_ptr) (FriBidiChar *, FriBidiStrIndex,
                                  FriBidiCharType *, FriBidiChar *,
                                  FriBidiStrIndex *, FriBidiStrIndex *,
                                  FriBidiLevel *);
 
+    if (skip_out)
+    	return NULL;
     dlerror();  /* clear error state */
-    if (!handle)
+    if (!handle) {
 	handle = dlopen("/usr/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL);
-    dlerror();
-    if (!handle)
+	/* call dlerror() on failure to clear error state in dlopen modules */
+	if (!handle) dlerror();
+    }
+    if (!handle) {
 	handle = dlopen("/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL);
-    if (!handle)
+    }
+    if (!handle) {
+    	dlerror();
+	skip_out = 1;
 	return NULL;
-
+    }
     func_ptr = dlsym(handle, "fribidi_log2vis");
     if (!func_ptr) {
-	dlclose(handle);
+    	skip_out = 1;
+	if (dlclose(handle)) 
+		dlerror();
 	handle = NULL;
 	return NULL;
     }
