aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid M. Syzdek <david@syzdek.net>2022-05-18 13:51:24 -0800
committerDavid M. Syzdek <david@syzdek.net>2022-05-18 13:51:24 -0800
commitbd82ca863e8340a927395dce56b6e8957f86e264 (patch)
tree6a14a543b85b20f014eaace8cd1bdcceebf03292
parent2cf00a07a302873cb48626df8e0e5cfd53f6e965 (diff)
downloadtinytac-bd82ca863e8340a927395dce56b6e8957f86e264.tar.gz
tinytac-bd82ca863e8340a927395dce56b6e8957f86e264.tar.bz2
tinytac-bd82ca863e8340a927395dce56b6e8957f86e264.tar.xz
tinytac-bd82ca863e8340a927395dce56b6e8957f86e264.zip
libtinytac: updating arguments to tinytac_initialize()
-rw-r--r--include/tinytac.h3
-rw-r--r--lib/libtinytac/libtinytac.h3
-rw-r--r--lib/libtinytac/lmemory.c16
3 files changed, 16 insertions, 6 deletions
diff --git a/include/tinytac.h b/include/tinytac.h
index c4c7e3b..f49e9ed 100644
--- a/include/tinytac.h
+++ b/include/tinytac.h
@@ -275,7 +275,8 @@ tinytac_get_option(
275_TINYTAC_F int 275_TINYTAC_F int
276tinytac_initialize( 276tinytac_initialize(
277 TinyTac ** ttp, 277 TinyTac ** ttp,
278 const char * url, 278 const char * hosts,
279 const char * key,
279 unsigned opts ); 280 unsigned opts );
280 281
281 282
diff --git a/lib/libtinytac/libtinytac.h b/lib/libtinytac/libtinytac.h
index 56ed42b..b478e4b 100644
--- a/lib/libtinytac/libtinytac.h
+++ b/lib/libtinytac/libtinytac.h
@@ -109,7 +109,8 @@ typedef struct _tinytac_obj
109struct _tinytac 109struct _tinytac
110{ 110{
111 TinyTacObj obj; 111 TinyTacObj obj;
112 char * url; 112 char * hosts;
113 char * key;
113 unsigned opts; 114 unsigned opts;
114 unsigned opts_neg; 115 unsigned opts_neg;
115}; 116};
diff --git a/lib/libtinytac/lmemory.c b/lib/libtinytac/lmemory.c
index 11d0398..64595d7 100644
--- a/lib/libtinytac/lmemory.c
+++ b/lib/libtinytac/lmemory.c
@@ -119,8 +119,10 @@ tinytac_tiytac_free(
119 119
120 assert(tt != NULL); 120 assert(tt != NULL);
121 121
122 if ((tt->url)) 122 if ((tt->hosts))
123 free(tt->url); 123 free(tt->hosts);
124 if ((tt->key))
125 free(tt->key);
124 126
125 memset(tt, 0, sizeof(TinyTac)); 127 memset(tt, 0, sizeof(TinyTac));
126 free(tt); 128 free(tt);
@@ -132,7 +134,8 @@ tinytac_tiytac_free(
132int 134int
133tinytac_initialize( 135tinytac_initialize(
134 TinyTac ** ttp, 136 TinyTac ** ttp,
135 const char * url, 137 const char * hosts,
138 const char * key,
136 unsigned opts ) 139 unsigned opts )
137{ 140{
138 TinyTac * tt; 141 TinyTac * tt;
@@ -145,7 +148,12 @@ tinytac_initialize(
145 return(TTAC_ENOMEM); 148 return(TTAC_ENOMEM);
146 tt->opts = opts; 149 tt->opts = opts;
147 150
148 if ((tt->url = strdup(url)) == NULL) 151 if ((tt->hosts = strdup(hosts)) == NULL)
152 {
153 tinytac_tiytac_free(tt);
154 return(TTAC_ENOMEM);
155 };
156 if ((tt->key = strdup(key)) == NULL)
149 { 157 {
150 tinytac_tiytac_free(tt); 158 tinytac_tiytac_free(tt);
151 return(TTAC_ENOMEM); 159 return(TTAC_ENOMEM);