about summary refs log tree commit diff
path: root/posix/regcomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/regcomp.c')
-rw-r--r--posix/regcomp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 2053b024dc..37e06797ac 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -774,8 +774,6 @@ re_compile_internal (preg, pattern, length, syntax)
     }
   preg->used = sizeof (re_dfa_t);
 
-  __libc_lock_init (dfa->lock);
-
   err = init_dfa (dfa, length);
   if (BE (err != REG_NOERROR, 0))
     {
@@ -789,6 +787,8 @@ re_compile_internal (preg, pattern, length, syntax)
   strncpy (dfa->re_str, pattern, length + 1);
 #endif
 
+  __libc_lock_init (dfa->lock);
+
   err = re_string_construct (&regexp, pattern, length, preg->translate,
 			     syntax & RE_ICASE, dfa);
   if (BE (err != REG_NOERROR, 0))