155682Smarkm/*
2233294Sstas * Copyright (c) 1997 - 2005 Kungliga Tekniska H��gskolan
3233294Sstas * (Royal Institute of Technology, Stockholm, Sweden).
4233294Sstas * All rights reserved.
555682Smarkm *
6233294Sstas * Portions Copyright (c) 2009 Apple Inc. All rights reserved.
755682Smarkm *
8233294Sstas * Redistribution and use in source and binary forms, with or without
9233294Sstas * modification, are permitted provided that the following conditions
10233294Sstas * are met:
1155682Smarkm *
12233294Sstas * 1. Redistributions of source code must retain the above copyright
13233294Sstas *    notice, this list of conditions and the following disclaimer.
1455682Smarkm *
15233294Sstas * 2. Redistributions in binary form must reproduce the above copyright
16233294Sstas *    notice, this list of conditions and the following disclaimer in the
17233294Sstas *    documentation and/or other materials provided with the distribution.
1855682Smarkm *
19233294Sstas * 3. Neither the name of the Institute nor the names of its contributors
20233294Sstas *    may be used to endorse or promote products derived from this software
21233294Sstas *    without specific prior written permission.
22233294Sstas *
23233294Sstas * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
24233294Sstas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25233294Sstas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26233294Sstas * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
27233294Sstas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28233294Sstas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29233294Sstas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30233294Sstas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31233294Sstas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32233294Sstas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33233294Sstas * SUCH DAMAGE.
3455682Smarkm */
3555682Smarkm
3655682Smarkm#include "der_locl.h"
3755682Smarkm
38233294SstasRCSID("$Id$");
3955682Smarkm
4055682Smarkmvoid
41178825Sdfrder_free_general_string (heim_general_string *str)
4255682Smarkm{
4355682Smarkm    free(*str);
44127808Snectar    *str = NULL;
4555682Smarkm}
4655682Smarkm
4755682Smarkmvoid
48233294Sstasder_free_integer (int *i)
49233294Sstas{
50233294Sstas    *i = 0;
51233294Sstas}
52233294Sstas
53233294Sstasvoid
54233294Sstasder_free_unsigned (unsigned *u)
55233294Sstas{
56233294Sstas    *u = 0;
57233294Sstas}
58233294Sstas
59233294Sstasvoid
60233294Sstasder_free_generalized_time(time_t *t)
61233294Sstas{
62233294Sstas    *t = 0;
63233294Sstas}
64233294Sstas
65233294Sstasvoid
66233294Sstasder_free_utctime(time_t *t)
67233294Sstas{
68233294Sstas    *t = 0;
69233294Sstas}
70233294Sstas
71233294Sstas
72233294Sstasvoid
73178825Sdfrder_free_utf8string (heim_utf8_string *str)
7455682Smarkm{
75178825Sdfr    free(*str);
76178825Sdfr    *str = NULL;
77178825Sdfr}
78178825Sdfr
79178825Sdfrvoid
80178825Sdfrder_free_printable_string (heim_printable_string *str)
81178825Sdfr{
82233294Sstas    der_free_octet_string(str);
83178825Sdfr}
84178825Sdfr
85178825Sdfrvoid
86178825Sdfrder_free_ia5_string (heim_ia5_string *str)
87178825Sdfr{
88233294Sstas    der_free_octet_string(str);
89178825Sdfr}
90178825Sdfr
91178825Sdfrvoid
92178825Sdfrder_free_bmp_string (heim_bmp_string *k)
93178825Sdfr{
9455682Smarkm    free(k->data);
95127808Snectar    k->data = NULL;
96178825Sdfr    k->length = 0;
9755682Smarkm}
9890926Snectar
9990926Snectarvoid
100178825Sdfrder_free_universal_string (heim_universal_string *k)
10190926Snectar{
102178825Sdfr    free(k->data);
103178825Sdfr    k->data = NULL;
104178825Sdfr    k->length = 0;
105178825Sdfr}
106178825Sdfr
107178825Sdfrvoid
108178825Sdfrder_free_visible_string (heim_visible_string *str)
109178825Sdfr{
110178825Sdfr    free(*str);
111178825Sdfr    *str = NULL;
112178825Sdfr}
113178825Sdfr
114178825Sdfrvoid
115178825Sdfrder_free_octet_string (heim_octet_string *k)
116178825Sdfr{
117178825Sdfr    free(k->data);
118178825Sdfr    k->data = NULL;
119178825Sdfr    k->length = 0;
120178825Sdfr}
121178825Sdfr
122178825Sdfrvoid
123178825Sdfrder_free_heim_integer (heim_integer *k)
124178825Sdfr{
125178825Sdfr    free(k->data);
126178825Sdfr    k->data = NULL;
127178825Sdfr    k->length = 0;
128178825Sdfr}
129178825Sdfr
130178825Sdfrvoid
131178825Sdfrder_free_oid (heim_oid *k)
132178825Sdfr{
13390926Snectar    free(k->components);
134127808Snectar    k->components = NULL;
135178825Sdfr    k->length = 0;
13690926Snectar}
137178825Sdfr
138178825Sdfrvoid
139178825Sdfrder_free_bit_string (heim_bit_string *k)
140178825Sdfr{
141178825Sdfr    free(k->data);
142178825Sdfr    k->data = NULL;
143178825Sdfr    k->length = 0;
144178825Sdfr}
145