X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fsolr.c;h=73950b4a9c59ae09435139bfc3da7f699d51faa7;hp=9897bb1799ec91c2d4ce5cab41e13b33e631437e;hb=1932238af8876622f567da122fb52fb3791c9514;hpb=4db187fbff08310195d08260817d7aa63f1fa4bc diff --git a/src/solr.c b/src/solr.c index 9897bb1..73950b4 100644 --- a/src/solr.c +++ b/src/solr.c @@ -87,9 +87,8 @@ static void yaz_solr_decode_result_docs(ODR o, xmlNodePtr ptr, record->recordSchema = 0; record->recordPacking = Z_SRW_recordPacking_XML; record->recordData_len = buf->use; - record->recordData_buf = odr_malloc(o, buf->use + 1); - memcpy(record->recordData_buf, buf->content, buf->use); - record->recordData_buf[buf->use] = '\0'; + record->recordData_buf = + odr_strdupn(o, (const char *) buf->content, buf->use); record->recordPosition = odr_intdup(o, start + offset + 1); xmlBufferFree(buf);