cleanup, put backreference to SASL plug in library
[cyrus-sasl.git] / lib / client.c
index 9fdcf46..91c2e2d 100644 (file)
@@ -652,6 +652,7 @@ int sasl_client_step(sasl_conn_t *conn,
   if(clientoutlen) *clientoutlen = 0;
 
   /* do a step */
+  c_conn->cparams->plug = c_conn->mech->m.plug;
   result = c_conn->mech->m.plug->mech_step(conn->context,
                                         c_conn->cparams,
                                         serverin,
@@ -660,6 +661,7 @@ int sasl_client_step(sasl_conn_t *conn,
                                         clientout, clientoutlen,
                                         &conn->oparams);
 
+  c_conn->cparams->plug = NULL;
   if (result == SASL_OK) {
       /* So we're done on this end, but if both
        * 1. the mech does server-send-last