diff options
-rw-r--r-- | src/common/memarea.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/memarea.c b/src/common/memarea.c index 7eb54821b9..6e0bda0c8a 100644 --- a/src/common/memarea.c +++ b/src/common/memarea.c @@ -241,7 +241,8 @@ memarea_strndup(memarea_t *area, const char *s, size_t n) ; /* cp now points to s+n, or to the 0 in the string. */ ln = cp-s; - result = memarea_memdup(area, s, ln+1); + result = memarea_alloc(area, ln+1); + memcpy(result, s, ln); result[ln]='\0'; return result; } |