wrbuf_destroy allows NULL WRBUF passed to it
[yaz-moved-to-github.git] / test / tstwrbuf.c
index c9c4349..af06e40 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2009 Index Data
+ * Copyright (C) 1995-2010 Index Data
  * See the file LICENSE for details.
  */
 
 static void tstwrbuf(void)
 {
     int step;
-    WRBUF wr = wrbuf_alloc();
+    WRBUF wr;
 
-    YAZ_CHECK(wr);
+    wr = 0;
+    wrbuf_destroy(wr);
 
+    wr = wrbuf_alloc();
+    YAZ_CHECK(wr);
     wrbuf_destroy(wr);
 
     wr = wrbuf_alloc();