summaryrefslogtreecommitdiff
path: root/fitz/base_memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/base_memory.c')
-rw-r--r--fitz/base_memory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fitz/base_memory.c b/fitz/base_memory.c
index e583dc9e..1f224ddb 100644
--- a/fitz/base_memory.c
+++ b/fitz/base_memory.c
@@ -23,9 +23,10 @@ void fz_free(void *p)
char * fz_strdup(char *s)
{
- char *ns = strdup(s);
+ char *ns = malloc(strlen(s) + 1);
if (!ns)
fz_throw("cannot strdup %lu bytes", (unsigned long)strlen(s) + 1);
+ memcpy(ns, s, strlen(s) + 1);
return ns;
}