diff -Naur a/encoding.c b/encoding.c
--- a/encoding.c	2013-10-30 19:15:08.000000000 +0530
+++ b/encoding.c	2013-10-30 19:29:35.000000000 +0530
@@ -2851,14 +2851,20 @@
 xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
     int ret = 0;
     int tofree = 0;
+    bool handler_in_list = false;
     if (handler == NULL) return(-1);
     if (handler->name == NULL) return(-1);
+    if (handlers != NULL) {
+        for (i = 0;i < nbCharEncodingHandler; i++) {
+		if (handler == handlers[i]) handler_in_list=true;
+	}
+    }
 #ifdef LIBXML_ICONV_ENABLED
     /*
      * Iconv handlers can be used only once, free the whole block.
      * and the associated icon resources.
      */
-    if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) {
+    if ((handler_in_list == false) && ((handler->iconv_out != NULL) || (handler->iconv_in != NULL))) {
         tofree = 1;
 	if (handler->iconv_out != NULL) {
 	    if (iconv_close(handler->iconv_out))
@@ -2873,7 +2879,7 @@
     }
 #endif /* LIBXML_ICONV_ENABLED */
 #ifdef LIBXML_ICU_ENABLED
-    if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) {
+    if ((handler_in_list == false) && ((handler->uconv_out != NULL) || (handler->uconv_in != NULL))) {
         tofree = 1;
 	if (handler->uconv_out != NULL) {
 	    closeIcuConverter(handler->uconv_out);
