From: Brian Aker Date: Sun, 13 Jun 2010 21:04:20 +0000 (-0700) Subject: Fix for SASL X-Git-Tag: 0.41~22 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=cf630fa0430ea62a93a8ed8c2845c68590d09ed1;p=awesomized%2Flibmemcached Fix for SASL --- diff --git a/libmemcached/connect.c b/libmemcached/connect.c index b17400ab..a43de956 100644 --- a/libmemcached/connect.c +++ b/libmemcached/connect.c @@ -373,7 +373,7 @@ static memcached_return_t network_connect(memcached_server_st *ptr) } #ifdef LIBMEMCACHED_WITH_SASL_SUPPORT - if (ptr->fd != -1 && ptr->root->sasl.callbacks != NULL) + if (ptr->fd != -1 && ptr->root->sasl && ptr->root->sasl->callbacks) { memcached_return rc= memcached_sasl_authenticate_connection(ptr); if (rc != MEMCACHED_SUCCESS) diff --git a/libmemcached/sasl.c b/libmemcached/sasl.c index 440b7638..85edeb3d 100644 --- a/libmemcached/sasl.c +++ b/libmemcached/sasl.c @@ -20,7 +20,10 @@ void memcached_set_sasl_callbacks(memcached_st *ptr, const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr) { - return ptr->sasl->callbacks; + if (ptr->sasl) + return ptr->sasl->callbacks; + + return NULL; } /**