aboutsummaryrefslogtreecommitdiff
path: root/src/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory.c')
-rw-r--r--src/memory.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/memory.c b/src/memory.c
index 5bc23284dc..53214d5265 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -214,6 +214,10 @@ char *xstrndup(const char *str, size_t len)
return xmemdupz(str, p ? (size_t)(p - str) : len);
}
+char *xmemdup(const char *data, size_t len)
+{
+ return memcpy(xmalloc(len), data, len);
+}
/*
* Avoid repeating the error message many times (they take 1 second each).