From bd82ca863e8340a927395dce56b6e8957f86e264 Mon Sep 17 00:00:00 2001 From: "David M. Syzdek" Date: Wed, 18 May 2022 13:51:24 -0800 Subject: libtinytac: updating arguments to tinytac_initialize() --- lib/libtinytac/libtinytac.h | 3 ++- lib/libtinytac/lmemory.c | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'lib') 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 struct _tinytac { TinyTacObj obj; - char * url; + char * hosts; + char * key; unsigned opts; unsigned opts_neg; }; 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( assert(tt != NULL); - if ((tt->url)) - free(tt->url); + if ((tt->hosts)) + free(tt->hosts); + if ((tt->key)) + free(tt->key); memset(tt, 0, sizeof(TinyTac)); free(tt); @@ -132,7 +134,8 @@ tinytac_tiytac_free( int tinytac_initialize( TinyTac ** ttp, - const char * url, + const char * hosts, + const char * key, unsigned opts ) { TinyTac * tt; @@ -145,7 +148,12 @@ tinytac_initialize( return(TTAC_ENOMEM); tt->opts = opts; - if ((tt->url = strdup(url)) == NULL) + if ((tt->hosts = strdup(hosts)) == NULL) + { + tinytac_tiytac_free(tt); + return(TTAC_ENOMEM); + }; + if ((tt->key = strdup(key)) == NULL) { tinytac_tiytac_free(tt); return(TTAC_ENOMEM); -- cgit v1.2.3