Reference count struct dictionary.
[pspp] / utilities / pspp-convert.c
index cd760199d3813340626727db584c85e13bca992c..217576ae7bcac55012f04dd7d1730ef1ede8f65b 100644 (file)
@@ -203,6 +203,8 @@ main (int argc, char *argv[])
              output_filename);
       NOT_REACHED ();
     }
+  if (!writer)
+    error (1, 0, _("%s: error opening output file"), output_filename);
 
   for (i = 0; i < max_cases; i++)
     {
@@ -221,7 +223,7 @@ main (int argc, char *argv[])
     error (1, 0, _("%s: error writing output file"), output_filename);
 
 exit:
-  dict_destroy (dict);
+  dict_unref (dict);
   fh_unref (output_fh);
   fh_unref (input_fh);
   fh_done ();
@@ -230,7 +232,7 @@ exit:
   return 0;
 
 error:
-  dict_destroy (dict);
+  dict_unref (dict);
   fh_unref (output_fh);
   fh_unref (input_fh);
   fh_done ();