LCOV - code coverage report
Current view: top level - lib/src - xfinish.c (source / functions) Hit Total Coverage
Test: GNU SASL Lines: 34 34 100.0 %
Date: 2024-01-02 22:40:18 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* xfinish.c --- Finish libgsasl session.
       2             :  * Copyright (C) 2002-2024 Simon Josefsson
       3             :  *
       4             :  * This file is part of GNU SASL Library.
       5             :  *
       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.
      10             :  *
      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.
      15             :  *
      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.
      20             :  *
      21             :  */
      22             : 
      23             : #include <config.h>
      24             : #include "internal.h"
      25             : 
      26             : /**
      27             :  * gsasl_finish:
      28             :  * @sctx: libgsasl session handle.
      29             :  *
      30             :  * Destroy a libgsasl client or server handle.  The handle must not be
      31             :  * used with other libgsasl functions after this call.
      32             :  **/
      33             : void
      34         525 : gsasl_finish (Gsasl_session *sctx)
      35             : {
      36         525 :   if (sctx == NULL)
      37           2 :     return;
      38             : 
      39         523 :   if (sctx->clientp)
      40             :     {
      41         306 :       if (sctx->mech && sctx->mech->client.finish)
      42         233 :         sctx->mech->client.finish (sctx, sctx->mech_data);
      43             :     }
      44             :   else
      45             :     {
      46         217 :       if (sctx->mech && sctx->mech->server.finish)
      47         162 :         sctx->mech->server.finish (sctx, sctx->mech_data);
      48             :     }
      49             : 
      50         523 :   free (sctx->anonymous_token);
      51         523 :   free (sctx->authid);
      52         523 :   free (sctx->authzid);
      53         523 :   free (sctx->password);
      54         523 :   free (sctx->passcode);
      55         523 :   free (sctx->pin);
      56         523 :   free (sctx->suggestedpin);
      57         523 :   free (sctx->service);
      58         523 :   free (sctx->hostname);
      59         523 :   free (sctx->gssapi_display_name);
      60         523 :   free (sctx->realm);
      61         523 :   free (sctx->digest_md5_hashed_password);
      62         523 :   free (sctx->qops);
      63         523 :   free (sctx->qop);
      64         523 :   free (sctx->scram_iter);
      65         523 :   free (sctx->scram_salt);
      66         523 :   free (sctx->scram_salted_password);
      67         523 :   free (sctx->scram_serverkey);
      68         523 :   free (sctx->scram_storedkey);
      69         523 :   free (sctx->cb_tls_unique);
      70         523 :   free (sctx->cb_tls_exporter);
      71         523 :   free (sctx->saml20_idp_identifier);
      72         523 :   free (sctx->saml20_redirect_url);
      73         523 :   free (sctx->openid20_redirect_url);
      74         523 :   free (sctx->openid20_outcome_data);
      75             :   /* If you add anything here, remember to change change map() in
      76             :      property.c and Gsasl_session in internal.h.  */
      77             : 
      78         523 :   free (sctx);
      79             : }

Generated by: LCOV version 1.16