diff options
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/misc.c b/src/misc.c index 4820a9fae..e3bcd899d 100644 --- a/src/misc.c +++ b/src/misc.c @@ -896,7 +896,7 @@ char *host_resolve(char *host) memcpy(&ip, hentp->h_addr, sizeof(hentp->h_length)); addr.s_addr = ip; ntoa(addr, ipbuf, sizeof(ipbuf)); - ipreturn = strdup(ipbuf); + ipreturn = anopeStrDup(ipbuf); if (debug) { alog("Resolved %s to %s",host, ipbuf); } @@ -907,3 +907,13 @@ char *host_resolve(char *host) } } +char *anopeStrDup(const char *src) { + char *ret=NULL; + if(src) { + if( (ret = (char *)malloc(strlen(src)+1)) ) {; + strcpy(ret,src); + } + } + return ret; +} + |