diff options
| author | David M. Syzdek <david@syzdek.net> | 2022-05-26 20:08:51 -0800 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2022-05-26 20:08:51 -0800 |
| commit | 3621746545555aefa5aa0c6d479039f994131595 (patch) | |
| tree | 6d1ef9ef6940967ff1b389a4d3ef6c3e7da7be23 | |
| parent | 49136d862777fd02df65f3d2a33e689031f38843 (diff) | |
| download | tinytac-3621746545555aefa5aa0c6d479039f994131595.tar.gz tinytac-3621746545555aefa5aa0c6d479039f994131595.tar.bz2 tinytac-3621746545555aefa5aa0c6d479039f994131595.tar.xz tinytac-3621746545555aefa5aa0c6d479039f994131595.zip | |
libtinytac: adding tinytac_tinytac_free_budps()
| -rw-r--r-- | lib/libtinytac/libtinytac.h | 1 | ||||
| -rw-r--r-- | lib/libtinytac/lmemory.c | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/libtinytac/libtinytac.h b/lib/libtinytac/libtinytac.h index 6554e94..db44183 100644 --- a/lib/libtinytac/libtinytac.h +++ b/lib/libtinytac/libtinytac.h | |||
| @@ -111,6 +111,7 @@ struct _tinytac | |||
| 111 | { | 111 | { |
| 112 | TinyTacObj obj; | 112 | TinyTacObj obj; |
| 113 | char * hosts; | 113 | char * hosts; |
| 114 | BindleURLDesc ** budps; | ||
| 114 | char ** keys; | 115 | char ** keys; |
| 115 | unsigned opts; | 116 | unsigned opts; |
| 116 | unsigned opts_neg; | 117 | unsigned opts_neg; |
diff --git a/lib/libtinytac/lmemory.c b/lib/libtinytac/lmemory.c index 2259e23..983d903 100644 --- a/lib/libtinytac/lmemory.c +++ b/lib/libtinytac/lmemory.c | |||
| @@ -81,6 +81,11 @@ tinytac_tinytac_free( | |||
| 81 | TinyTac * tt ); | 81 | TinyTac * tt ); |
| 82 | 82 | ||
| 83 | 83 | ||
| 84 | static void | ||
| 85 | tinytac_tinytac_free_budps( | ||
| 86 | BindleURLDesc ** budps ); | ||
| 87 | |||
| 88 | |||
| 84 | static int | 89 | static int |
| 85 | tinytac_set_option_flag( | 90 | tinytac_set_option_flag( |
| 86 | TinyTac * tt, | 91 | TinyTac * tt, |
| @@ -150,6 +155,8 @@ tinytac_tinytac_free( | |||
| 150 | if ((tt->keys)) | 155 | if ((tt->keys)) |
| 151 | tinytacb_strsfree(tt->keys); | 156 | tinytacb_strsfree(tt->keys); |
| 152 | 157 | ||
| 158 | tinytac_tinytac_free_budps(tt->budps); | ||
| 159 | |||
| 153 | memset(tt, 0, sizeof(TinyTac)); | 160 | memset(tt, 0, sizeof(TinyTac)); |
| 154 | free(tt); | 161 | free(tt); |
| 155 | 162 | ||
| @@ -157,6 +164,20 @@ tinytac_tinytac_free( | |||
| 157 | } | 164 | } |
| 158 | 165 | ||
| 159 | 166 | ||
| 167 | void | ||
| 168 | tinytac_tinytac_free_budps( | ||
| 169 | BindleURLDesc ** budps ) | ||
| 170 | { | ||
| 171 | size_t pos; | ||
| 172 | if (!(budps)) | ||
| 173 | return; | ||
| 174 | for(pos = 0; ((budps[pos])); pos++) | ||
| 175 | tinytacb_urldesc_free(budps[pos]); | ||
| 176 | free(budps); | ||
| 177 | return; | ||
| 178 | } | ||
| 179 | |||
| 180 | |||
| 160 | int | 181 | int |
| 161 | tinytac_get_option( | 182 | tinytac_get_option( |
| 162 | TinyTac * tt, | 183 | TinyTac * tt, |
