LCOV - code coverage report
Current view: top level - lib/src - xfinish.c (source / functions) Hit Total Coverage
Test: GNU SASL Lines: 31 31 100.0 %
Date: 2012-05-28 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 10 12 83.3 %

           Branch data     Line data    Source code
       1                 :            : /* xfinish.c --- Finish libgsasl session.
       2                 :            :  * Copyright (C) 2002-2012 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 "internal.h"
      24                 :            : 
      25                 :            : /**
      26                 :            :  * gsasl_finish:
      27                 :            :  * @sctx: libgsasl session handle.
      28                 :            :  *
      29                 :            :  * Destroy a libgsasl client or server handle.  The handle must not be
      30                 :            :  * used with other libgsasl functions after this call.
      31                 :            :  **/
      32                 :            : void
      33                 :        397 : gsasl_finish (Gsasl_session * sctx)
      34                 :            : {
      35         [ +  + ]:        397 :   if (sctx == NULL)
      36                 :        397 :     return;
      37                 :            : 
      38         [ +  + ]:        396 :   if (sctx->clientp)
      39                 :            :     {
      40 [ +  - ][ +  + ]:        206 :       if (sctx->mech && sctx->mech->client.finish)
      41                 :        132 :         sctx->mech->client.finish (sctx, sctx->mech_data);
      42                 :            :     }
      43                 :            :   else
      44                 :            :     {
      45 [ +  - ][ +  + ]:        190 :       if (sctx->mech && sctx->mech->server.finish)
      46                 :        129 :         sctx->mech->server.finish (sctx, sctx->mech_data);
      47                 :            :     }
      48                 :            : 
      49                 :        396 :   free (sctx->anonymous_token);
      50                 :        396 :   free (sctx->authid);
      51                 :        396 :   free (sctx->authzid);
      52                 :        396 :   free (sctx->password);
      53                 :        396 :   free (sctx->passcode);
      54                 :        396 :   free (sctx->pin);
      55                 :        396 :   free (sctx->suggestedpin);
      56                 :        396 :   free (sctx->service);
      57                 :        396 :   free (sctx->hostname);
      58                 :        396 :   free (sctx->gssapi_display_name);
      59                 :        396 :   free (sctx->realm);
      60                 :        396 :   free (sctx->digest_md5_hashed_password);
      61                 :        396 :   free (sctx->qops);
      62                 :        396 :   free (sctx->qop);
      63                 :        396 :   free (sctx->scram_iter);
      64                 :        396 :   free (sctx->scram_salt);
      65                 :        396 :   free (sctx->scram_salted_password);
      66                 :        396 :   free (sctx->cb_tls_unique);
      67                 :        396 :   free (sctx->saml20_idp_identifier);
      68                 :        396 :   free (sctx->saml20_redirect_url);
      69                 :        396 :   free (sctx->openid20_redirect_url);
      70                 :        396 :   free (sctx->openid20_outcome_data);
      71                 :            :   /* If you add anything here, remember to change change
      72                 :            :      gsasl_finish() in xfinish.c and Gsasl_session in internal.h.  */
      73                 :            : 
      74                 :        396 :   free (sctx);
      75                 :            : }

Generated by: LCOV version 1.9