Commit 4cd740f0 authored by Joe Orton's avatar Joe Orton
Browse files

* modules/ldap/util_ldap.c (LDAP_CACHE_LOCK, LDAP_CACHE_UNLOCK):

Wrap in do/while for safety.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@225732 13f79535-47bb-0310-9956-ffa450edef68
parent 35911505
Loading
Loading
Loading
Loading
+7 −5
Changes for modules/ldap/util_ldap.c: 7 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -91,13 +91,15 @@ static void *util_ldap_create_config(apr_pool_t *p, server_rec *s);
                          "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"
#endif

#define LDAP_CACHE_LOCK() \
#define LDAP_CACHE_LOCK() do {                                  \
    if (st->util_ldap_cache_lock)                               \
      apr_global_mutex_lock(st->util_ldap_cache_lock)
#define LDAP_CACHE_UNLOCK() \
    if (st->util_ldap_cache_lock) \
      apr_global_mutex_unlock(st->util_ldap_cache_lock)
        apr_global_mutex_lock(st->util_ldap_cache_lock);        \
} while (0)

#define LDAP_CACHE_UNLOCK() do {                                \
    if (st->util_ldap_cache_lock)                               \
        apr_global_mutex_unlock(st->util_ldap_cache_lock);      \
} while (0)

static void util_ldap_strdup (char **str, const char *newstr)
{