Revert "Fix control->suffix being deallocated as heap memory as reported by Pietro Borrello."

This reverts commit 5faf80cd53.

No longer needed without liblrzip.
This commit is contained in:
Con Kolivas 2022-02-26 09:21:45 +11:00
parent 23fc8a8f63
commit 23407bc8f7
2 changed files with 3 additions and 5 deletions

View file

@ -1359,7 +1359,7 @@ bool initialise_control(rzip_control *control)
control->msgerr = stderr; control->msgerr = stderr;
register_outputfile(control, control->msgout); register_outputfile(control, control->msgout);
control->flags = FLAG_SHOW_PROGRESS | FLAG_KEEP_FILES | FLAG_THRESHOLD; control->flags = FLAG_SHOW_PROGRESS | FLAG_KEEP_FILES | FLAG_THRESHOLD;
control->suffix = strdup(".lrz"); control->suffix = ".lrz";
control->compression_level = 7; control->compression_level = 7;
control->ramsize = get_ram(control); control->ramsize = get_ram(control);
if (unlikely(control->ramsize == -1)) if (unlikely(control->ramsize == -1))

6
main.c
View file

@ -461,8 +461,7 @@ int main(int argc, char *argv[])
if (unlikely(STDOUT)) if (unlikely(STDOUT))
failure("Cannot specify an output filename when outputting to stdout\n"); failure("Cannot specify an output filename when outputting to stdout\n");
control->outname = optarg; control->outname = optarg;
dealloc(control->suffix); control->suffix = "";
control->suffix = strdup("");
break; break;
case 'O': case 'O':
if (control->outname) /* can't mix -o and -O */ if (control->outname) /* can't mix -o and -O */
@ -497,8 +496,7 @@ int main(int argc, char *argv[])
failure("Specified output filename already, can't specify an extension.\n"); failure("Specified output filename already, can't specify an extension.\n");
if (unlikely(STDOUT)) if (unlikely(STDOUT))
failure("Cannot specify a filename suffix when outputting to stdout\n"); failure("Cannot specify a filename suffix when outputting to stdout\n");
dealloc(control->suffix); control->suffix = optarg;
control->suffix = strdup(optarg);
break; break;
case 't': case 't':
if (control->outname) if (control->outname)