aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'osdep.c')
-rw-r--r--osdep.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/osdep.c b/osdep.c
index 83f5a77cc..76bfa2663 100644
--- a/osdep.c
+++ b/osdep.c
@@ -294,6 +294,16 @@ void *qemu_mallocz(size_t size)
return ptr;
}
+char *qemu_strdup(const char *str)
+{
+ char *ptr;
+ ptr = qemu_malloc(strlen(str) + 1);
+ if (!ptr)
+ return NULL;
+ strcpy(ptr, str);
+ return ptr;
+}
+
/****************************************************************/
/* printf support */