(__duplocale): Update special members only when allocation succeeded.
authordrepper <drepper>
Sat, 4 May 2002 17:12:37 +0000 (17:12 +0000)
committerdrepper <drepper>
Sat, 4 May 2002 17:12:37 +0000 (17:12 +0000)
locale/duplocale.c

index 3fc46ba..efbacbb 100644 (file)
@@ -49,12 +49,12 @@ __duplocale (__locale_t dataset)
            if (result->__locales[cnt]->usage_count < MAX_USAGE_COUNT)
              ++result->__locales[cnt]->usage_count;
          }
-    }
 
-  /* Update the special members.  */
-  result->__ctype_b = dataset->__ctype_b;
-  result->__ctype_tolower = dataset->__ctype_tolower;
-  result->__ctype_toupper = dataset->__ctype_toupper;
+      /* Update the special members.  */
+      result->__ctype_b = dataset->__ctype_b;
+      result->__ctype_tolower = dataset->__ctype_tolower;
+      result->__ctype_toupper = dataset->__ctype_toupper;
+    }
 
   /* It's done.  */
   __libc_lock_unlock (__libc_setlocale_lock);