Implement cs_get_peer_certificate_x509 for GnuTLS
[yaz-moved-to-github.git] / src / pquery.c
index 55eb1d3..a9a6b60 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.
  */
 /**
@@ -386,9 +386,7 @@ static Z_Operand *rpn_simple(struct yaz_pqf_parser *li, ODR o,
             return 0;
         }
         zo->which = Z_Operand_resultSetId;
-        zo->u.resultSetId = (char *)odr_malloc(o, li->lex_len+1);
-        memcpy(zo->u.resultSetId, li->lex_buf, li->lex_len);
-        zo->u.resultSetId[li->lex_len] = '\0';
+        zo->u.resultSetId = odr_strdupn(o, li->lex_buf, li->lex_len);
         lex(li);
         break;
     default: