1 /* xfinish.c --- Finish libgsasl session.
2 * Copyright (C) 2002, 2003, 2004, 2005, 2006 Simon Josefsson
4 * This file is part of GNU SASL Library.
6 * GNU SASL Library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
11 * GNU SASL Library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License License along with GNU SASL Library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
27 * @sctx: libgsasl session handle.
29 * Destroy a libgsasl client or server handle. The handle must not be
30 * used with other libgsasl functions after this call.
33 gsasl_finish (Gsasl_session
* sctx
)
37 if (sctx
->mech
&& sctx
->mech
->client
.finish
)
38 sctx
->mech
->client
.finish (sctx
, sctx
->mech_data
);
42 if (sctx
->mech
&& sctx
->mech
->server
.finish
)
43 sctx
->mech
->server
.finish (sctx
, sctx
->mech_data
);
46 if (sctx
->anonymous_token
)
47 free (sctx
->anonymous_token
);
56 free (sctx
->password
);
59 free (sctx
->passcode
);
64 if (sctx
->suggestedpin
)
65 free (sctx
->suggestedpin
);
71 free (sctx
->hostname
);
73 if (sctx
->gssapi_display_name
)
74 free (sctx
->gssapi_display_name
);