X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fprint.c;h=061aafc628f89fb56dadb55b3d4138badf316063;hb=5729150f2c4a00caf688e7e3b514b10b1987e211;hp=63270160d949dd9654776fd13ffa4e8572415cd0;hpb=81fff61a96bece351e381ad3fef8ab1248a952ba;p=pspp diff --git a/src/language/data-io/print.c b/src/language/data-io/print.c index 63270160d9..061aafc628 100644 --- a/src/language/data-io/print.c +++ b/src/language/data-io/print.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -141,7 +142,7 @@ static int internal_cmd_print (int f) { int table = 0; /* Print table? */ - struct print_trns *trns; /* malloc()'d transformation. */ + struct print_trns *trns = NULL; /* malloc()'d transformation. */ struct file_handle *fh = NULL; /* Fill in prt to facilitate error-handling. */ @@ -350,7 +351,7 @@ parse_string_argument (void) { fx.spec.type = PRT_CONST; fx.spec.fc = fx.sc - 1; - fx.spec.u.c = xstrdup (ds_c_str (&tokstr)); + fx.spec.u.c = ds_xstrdup (&tokstr); lex_get (); /* Parse the included column range. */ @@ -966,7 +967,7 @@ print_trns_proc (void *trns_, struct ccase *c, int case_num UNUSED) return TRNS_CONTINUE; } -/* Frees all the data inside print_trns T. Does not free T. */ +/* Frees all the data inside print_trns PRT. Does not free PRT. */ static bool print_trns_free (void *prt_) { @@ -996,7 +997,6 @@ print_trns_free (void *prt_) if (prt->writer != NULL) ok = dfm_close_writer (prt->writer); free (prt->line); - free (prt); return ok; }