00001 /* xfinish.c --- Finish libgsasl session. 00002 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 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 00025 #define free_if_nonnull(p) if ((p)) free ((p)) 00026 00034 void 00035 gsasl_finish (Gsasl_session * sctx) 00036 { 00037 if (sctx->clientp) 00038 { 00039 if (sctx->mech && sctx->mech->client.finish) 00040 sctx->mech->client.finish (sctx, sctx->mech_data); 00041 } 00042 else 00043 { 00044 if (sctx->mech && sctx->mech->server.finish) 00045 sctx->mech->server.finish (sctx, sctx->mech_data); 00046 } 00047 00048 free_if_nonnull (sctx->anonymous_token); 00049 free_if_nonnull (sctx->authid); 00050 free_if_nonnull (sctx->authzid); 00051 free_if_nonnull (sctx->password); 00052 free_if_nonnull (sctx->passcode); 00053 free_if_nonnull (sctx->pin); 00054 free_if_nonnull (sctx->suggestedpin); 00055 free_if_nonnull (sctx->service); 00056 free_if_nonnull (sctx->hostname); 00057 free_if_nonnull (sctx->gssapi_display_name); 00058 free_if_nonnull (sctx->realm); 00059 free_if_nonnull (sctx->digest_md5_hashed_password); 00060 00061 free_if_nonnull (sctx); 00062 }
1.5.6