X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fget.c;h=789d259e6cbb1a3a197788ff92ed64b7d3f439e8;hb=57b436a22d9ae0e395fb2e3ce101c2b5c2e6939e;hp=cdae706653af17a12965ed1f3b85b6dabb10cc9e;hpb=5e89e0049bd55f22412f547d8d7bfefc69443e98;p=pspp-builds.git diff --git a/src/language/data-io/get.c b/src/language/data-io/get.c index cdae7066..789d259e 100644 --- a/src/language/data-io/get.c +++ b/src/language/data-io/get.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -439,6 +442,8 @@ parse_write_command (enum writer_type writer_type, } else aw->writer = any_writer_open (handle, dict); + if (aw->writer == NULL) + goto error; dict_destroy (dict); return aw; @@ -840,7 +845,7 @@ cmd_match_files (void) saw_table = true; } else - assert (0); + NOT_REACHED (); lex_match ('='); file->by = NULL; @@ -1122,7 +1127,7 @@ cmd_match_files (void) discard_variables (); dict_compact_values (mtf.dict); - mtf.output = casefile_create (dict_get_next_value_idx (mtf.dict)); + mtf.output = fastfile_create (dict_get_next_value_idx (mtf.dict)); mtf.seq_nums = xcalloc (dict_get_var_cnt (mtf.dict), sizeof *mtf.seq_nums); case_create (&mtf.mtf_case, dict_get_next_value_idx (mtf.dict)); @@ -1139,6 +1144,7 @@ cmd_match_files (void) discard_variables (); + dict_destroy (default_dict); default_dict = mtf.dict; mtf.dict = NULL; proc_set_source (storage_source_create (mtf.output)); @@ -1165,7 +1171,7 @@ mtf_processing_finish (void *mtf_) if (iter->handle == NULL) { if (!mtf_delete_file_in_place (mtf, &iter)) - abort (); + NOT_REACHED (); break; } @@ -1540,8 +1546,11 @@ mtf_merge_dictionary (struct dictionary *const m, struct mtf_file *f) if (dv->width == mv->width) { if (val_labs_count (dv->val_labs) - && !val_labs_count (mv->val_labs)) - mv->val_labs = val_labs_copy (dv->val_labs); + && !val_labs_count (mv->val_labs)) + { + val_labs_destroy (mv->val_labs); + mv->val_labs = val_labs_copy (dv->val_labs); + } if (!mv_is_empty (&dv->miss) && mv_is_empty (&mv->miss)) mv_copy (&mv->miss, &dv->miss); }