tcpip: initialize ai_connect
[yaz-moved-to-github.git] / src / odr_mem.c
index 28181e3..71a10e1 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
+ * Copyright (C) Index Data
  * See the file LICENSE for details.
  */
 /**
@@ -65,8 +65,7 @@ size_t odr_total(ODR o)
 Odr_oct *odr_create_Odr_oct(ODR o, const char *buf, int sz)
 {
     Odr_oct *p = (Odr_oct *) odr_malloc(o, sizeof(Odr_oct));
-    p->buf = (char *) odr_malloc(o, sz);
-    memcpy(p->buf, buf, sz);
+    p->buf = odr_strdupn(o, buf, sz);
     p->len = sz;
     return p;
 }