diff 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
line wrap: on
line diff
--- a/dbutil.c	Thu Jun 03 16:45:53 2004 +0000
+++ b/dbutil.c	Thu Jun 03 17:22:48 2004 +0000
@@ -158,7 +158,7 @@
 		retstring = host->h_name;
 	}
 
-	return strdup(retstring);
+	return m_strdup(retstring);
 }
 #ifdef DEBUG_TRACE
 void printhex(unsigned char* buf, int len) {
@@ -263,6 +263,16 @@
 
 }
 
+void * m_strdup(const char * str) {
+	char* ret;
+
+	ret = strdup(str);
+	if (ret == NULL) {
+		dropbear_exit("m_strdup failed");
+	}
+	return ret;
+}
+
 void __m_free(void* ptr) {
 	if (ptr != NULL) {
 		free(ptr);