diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c index d3d521b928..2b735e8413 100644 --- a/src/util.c +++ b/src/util.c @@ -6050,3 +6050,16 @@ finish: return buf; } + +void* memdup(const void *p, size_t l) { + void *r; + + assert(p); + + r = malloc(l); + if (!r) + return NULL; + + memcpy(r, p, l); + return r; +} |