diff options
Diffstat (limited to 'lib/libtinytac/lmemory.c')
| -rw-r--r-- | lib/libtinytac/lmemory.c | 16 |
1 files changed, 12 insertions, 4 deletions
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( | |||
| 132 | int | 134 | int |
| 133 | tinytac_initialize( | 135 | tinytac_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); |
