/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/**
x->indirect_reference = 0;
x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_octet;
- x->u.octet_aligned = (Odr_oct *) odr_malloc(odr, sizeof(Odr_oct));
- x->u.octet_aligned->buf = (unsigned char *) odr_malloc(odr, octet_len);
- memcpy(x->u.octet_aligned->buf, octet_buf, octet_len);
- x->u.octet_aligned->len = octet_len;
+ x->u.octet_aligned = odr_create_Odr_oct(odr, octet_buf, octet_len);
odr_destroy(encode);