Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
dad8d67e
Commit
dad8d67e
authored
Dec 30, 1998
by
Bob Halley
Browse files
add isc_mem_strdup
parent
566f721b
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/isc/include/isc/mem.h
View file @
dad8d67e
...
...
@@ -46,6 +46,7 @@ void isc_mem_stats(isc_mem_t *, FILE *);
isc_boolean_t
isc_mem_valid
(
isc_mem_t
*
,
void
*
);
void
*
isc_mem_allocate
(
isc_mem_t
*
,
size_t
);
void
isc_mem_free
(
isc_mem_t
*
,
void
*
);
char
*
isc_mem_strdup
(
isc_mem_t
*
,
const
char
*
);
#ifdef ISC_MEMCLUSTER_LEGACY
...
...
lib/isc/mem.c
View file @
dad8d67e
...
...
@@ -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
/*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment