comparison dbutil.c @ 11:f76c9389e9e0

Mostly done with the listener changeover
author Matt Johnston <matt@ucc.asn.au>
date Thu, 03 Jun 2004 17:22:48 +0000
parents fe6bca95afa7
children 0969767bca0d
comparison
equal deleted inserted replaced
9:7f77962de998 11:f76c9389e9e0
156 } else { 156 } else {
157 /* return the hostname */ 157 /* return the hostname */
158 retstring = host->h_name; 158 retstring = host->h_name;
159 } 159 }
160 160
161 return strdup(retstring); 161 return m_strdup(retstring);
162 } 162 }
163 #ifdef DEBUG_TRACE 163 #ifdef DEBUG_TRACE
164 void printhex(unsigned char* buf, int len) { 164 void printhex(unsigned char* buf, int len) {
165 165
166 int i; 166 int i;
261 } 261 }
262 return ret; 262 return ret;
263 263
264 } 264 }
265 265
266 void * m_strdup(const char * str) {
267 char* ret;
268
269 ret = strdup(str);
270 if (ret == NULL) {
271 dropbear_exit("m_strdup failed");
272 }
273 return ret;
274 }
275
266 void __m_free(void* ptr) { 276 void __m_free(void* ptr) {
267 if (ptr != NULL) { 277 if (ptr != NULL) {
268 free(ptr); 278 free(ptr);
269 } 279 }
270 } 280 }