(_nl_find_msg): Free encoding if __gconv_open failed.
authordrepper <drepper>
Fri, 3 Aug 2007 15:49:59 +0000 (15:49 +0000)
committerdrepper <drepper>
Fri, 3 Aug 2007 15:49:59 +0000 (15:49 +0000)
intl/dcigettext.c

index 23e019a..ad2835f 100644 (file)
@@ -949,7 +949,10 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
                           nothing to do.  Otherwise do not use the
                           translation at all.  */
                        if (__builtin_expect (r != __GCONV_NULCONV, 1))
-                         return NULL;
+                         {
+                           free ((char *) encoding);
+                           return NULL;
+                         }
 
                        convd->conv = (__gconv_t) -1;
                      }