X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Futil.cpp;h=062c497bd0f7424868fb8deb353b80d1139f4f56;hb=03e8dbd1c27b7ac1540e1710becc7d4ecf7fdb95;hp=aef7caa77d78264ffc95e7869f96846cb908acbc;hpb=8ff69c27be66eb65b0b5fd6afa4de1a3556d7344;p=metaproxy-moved-to-github.git diff --git a/src/util.cpp b/src/util.cpp index aef7caa..062c497 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -500,15 +500,9 @@ void mp_util::transfer_referenceId(ODR odr, const Z_APDU *src, Z_APDU *dst) if (src) { Z_ReferenceId **id_from = mp::util::get_referenceId(src); - if (id_from && *id_from && id_to) - { - *id_to = (Z_ReferenceId*) odr_malloc (odr, sizeof(**id_to)); - (*id_to)->size = (*id_to)->len = (*id_from)->len; - (*id_to)->buf = (unsigned char*) odr_malloc(odr, (*id_to)->len); - memcpy((*id_to)->buf, (*id_from)->buf, (*id_to)->len); - } - else if (id_to) - *id_to = 0; + if (id_from && *id_from) + *id_to = odr_create_Odr_oct(odr, (*id_from)->buf, + (*id_from)->len); } }