From 0d6944bd3f8cb19f7e4867f979ba753cd7e11110 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 7 Jul 2012 21:02:35 +1000 Subject: [PATCH] Fix invalid free error when -o and -S are used together. --- main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 8e2f112..6eb8a25 100644 --- a/main.c +++ b/main.c @@ -281,13 +281,11 @@ int main(int argc, char *argv[]) failure("Invalid nice value (must be -20..19)\n"); break; case 'o': - if (control->outdir) - failure("Cannot have -o and -O together\n"); + if (control->outdir || control->suffix) + failure("Cannot have -o and -O or -S together\n"); if (unlikely(STDOUT)) failure("Cannot specify an output filename when outputting to stdout\n"); control->outname = optarg; - free(control->suffix); - control->suffix = ""; break; case 'O': if (control->outname) /* can't mix -o and -O */