2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

add isc_mem_strdup

This commit is contained in:
Bob Halley
1998-12-30 20:17:02 +00:00
parent 566f721b3a
commit dad8d67ed0
2 changed files with 15 additions and 0 deletions

View File

@@ -438,6 +438,20 @@ isc_mem_free(isc_mem_t *ctx, void *ptr) {
isc_mem_put(ctx, si, si->size);
}
char *
isc_mem_strdup(isc_mem_t *mctx, const char *s) {
size_t len;
char *ns;
len = strlen(s);
ns = isc_mem_allocate(mctx, len + 1);
if (ns == NULL)
return (NULL);
strncpy(ns, s, len + 1);
return (ns);
}
#ifdef ISC_MEMCLUSTER_LEGACY
/*