]> git.sur5r.net Git - openldap/blobdiff - libraries/librewrite/xmap.c
Happy New Year
[openldap] / libraries / librewrite / xmap.c
index f50eac06b1b990ed4a02fbbcbaa7a625aa2b1330..8c09f5a0ce7127eb8c18dd1fbed260afe281356e 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2013 The OpenLDAP Foundation.
+ * Copyright 2000-2018 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -335,7 +335,11 @@ rewrite_xmap_apply(
                                        && ( p = strtok( NULL, "" ) ) ) {
                                val->bv_val = strdup( p );
                                if ( val->bv_val == NULL ) {
-                                       return REWRITE_ERR;
+#ifdef USE_REWRITE_LDAP_PVT_THREADS
+                                       ldap_pvt_thread_mutex_unlock( &map->lm_mutex );
+#endif /* USE_REWRITE_LDAP_PVT_THREADS */
+                                       rc = REWRITE_ERR;
+                                       goto rc_return;
                                }
 
                                val->bv_len = strlen( p );