gsasl  2.2.1
digest-md5/free.c
Go to the documentation of this file.
1 /* free.h --- Free allocated data in DIGEST-MD5 token structures.
2  * Copyright (C) 2004-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 along with GNU SASL Library; if not, write to the Free
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include <config.h>
24 
25 /* Get prototypes. */
26 #include "free.h"
27 
28 /* Get free. */
29 #include <stdlib.h>
30 
31 /* Get memset. */
32 #include <string.h>
33 
34 void
36 {
37  size_t i;
38 
39  for (i = 0; i < c->nrealms; i++)
40  free (c->realms[i]);
41  free (c->realms);
42  free (c->nonce);
43 
44  memset (c, 0, sizeof (*c));
45 }
46 
47 void
49 {
50  free (r->username);
51  free (r->realm);
52  free (r->nonce);
53  free (r->cnonce);
54  free (r->digesturi);
55  free (r->authzid);
56 
57  memset (r, 0, sizeof (*r));
58 }
59 
60 void
62 {
63  memset (f, 0, sizeof (*f));
64 }
void digest_md5_free_finish(digest_md5_finish *f)
void digest_md5_free_response(digest_md5_response *r)
void digest_md5_free_challenge(digest_md5_challenge *c)