Fixed bug writing portable files.
[pspp-builds.git] / src / language / dictionary / sys-file-info.c
index 2369b99ec809d92679b21e9c69ae186ea346e101..b98854db6ea290a053a43fa377b6d0e4d246b305 100644 (file)
@@ -99,7 +99,10 @@ cmd_sysfile_info (struct lexer *lexer, struct dataset *ds UNUSED)
 
   reader = sfm_open_reader (h, &d, &info);
   if (!reader)
-    return CMD_FAILURE;
+    {
+      fh_unref (h);
+      return CMD_FAILURE;
+    }
   casereader_destroy (reader);
 
   t = tab_create (2, 10, 0);
@@ -184,6 +187,7 @@ cmd_sysfile_info (struct lexer *lexer, struct dataset *ds UNUSED)
 
   dict_destroy (d);
 
+  fh_unref (h);
   return lex_end_of_command (lexer);
 }
 \f
@@ -419,7 +423,7 @@ display_variables (const struct variable **vl, size_t n, int as)
             {
               const char *label = var_get_label (v);
               tab_joint_text (t, 1, r, 2, r, TAB_LEFT,
-                              label != NULL ? "(no label)" : label);
+                              label == NULL ? "(no label)" : label);
             }
          if (as != AS_NAMES)
            {