00001 /* xfinish.c --- Finish libgsasl session. 00002 * Copyright (C) 2002, 2003, 2004, 2005 Simon Josefsson 00003 * 00004 * This file is part of GNU SASL Library. 00005 * 00006 * GNU SASL Library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public License 00008 * as published by the Free Software Foundation; either version 2.1 of 00009 * the License, or (at your option) any later version. 00010 * 00011 * GNU SASL Library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License License along with GNU SASL Library; if not, write to the 00018 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 */ 00022 00023 #include "internal.h" 00024 00032 void 00033 gsasl_finish (Gsasl_session * sctx) 00034 { 00035 if (sctx->clientp) 00036 { 00037 if (sctx->mech->client.finish) 00038 sctx->mech->client.finish (sctx, sctx->mech_data); 00039 } 00040 else 00041 { 00042 if (sctx->mech->server.finish) 00043 sctx->mech->server.finish (sctx, sctx->mech_data); 00044 } 00045 00046 if (sctx->anonymous_token) 00047 free (sctx->anonymous_token); 00048 00049 if (sctx->authid) 00050 free (sctx->authid); 00051 00052 if (sctx->authzid) 00053 free (sctx->authzid); 00054 00055 if (sctx->password) 00056 free (sctx->password); 00057 00058 if (sctx->passcode) 00059 free (sctx->passcode); 00060 00061 if (sctx->pin) 00062 free (sctx->pin); 00063 00064 if (sctx->suggestedpin) 00065 free (sctx->suggestedpin); 00066 00067 if (sctx->service) 00068 free (sctx->service); 00069 00070 if (sctx->hostname) 00071 free (sctx->hostname); 00072 00073 if (sctx->gssapi_display_name) 00074 free (sctx->gssapi_display_name); 00075 00076 if (sctx->realm) 00077 free (sctx->realm); 00078 00079 free (sctx); 00080 }