Use AM_LDFLAGS instead of LDFLAGS
[yazpp-moved-to-github.git] / src / yaz-z-query.cpp
index 8d391d5..5e8ba84 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1998-2003, Index Data.
  * See the file LICENSE for details.
  * 
- * $Id: yaz-z-query.cpp,v 1.13 2003-10-03 13:01:42 adam Exp $
+ * $Id: yaz-z-query.cpp,v 1.15 2003-12-20 22:42:53 adam Exp $
  */
 
 #include <yaz++/z-query.h>
@@ -78,9 +78,9 @@ void Yaz_Z_Query::print(char *str, int len)
        }
        else
            strcpy(str, wrbuf_buf(wbuf));
+       wrbuf_free(wbuf,1);
     }
     odr_reset(odr_decode);
-    wrbuf_free(wbuf,1);
 }
 
 int Yaz_Z_Query::match(Yaz_Z_Query *other)
@@ -179,10 +179,9 @@ int Yaz_Z_Query::rpn2pquery(Z_RPNStructure *s, WRBUF buf)
 
 WRBUF Yaz_Z_Query::zquery2pquery(Z_Query *q)
 {
-    WRBUF buf = wrbuf_alloc();
-
     if (q->which != Z_Query_type_1 && q->which != Z_Query_type_101) 
        return 0;
+    WRBUF buf = wrbuf_alloc();
     if (q->u.type_1->attributeSetId) {
        /* Output attribute set ID */
        wrbuf_puts(buf, "@attrset ");