opusenc: Avoid leak on multiple save-range options
authorMark Harris <mark.hsj@gmail.com>
Sat, 10 Mar 2018 21:01:40 +0000 (13:01 -0800)
committerMark Harris <mark.hsj@gmail.com>
Sat, 21 Apr 2018 22:19:44 +0000 (15:19 -0700)
src/opusenc.c

index af88024..89843b5 100644 (file)
@@ -597,6 +597,7 @@ int main(int argc, char **argv)
           opt_ctls_ctlval[opt_ctls*3+2]=atoi(spos+1);
           opt_ctls++;
         } else if (strcmp(optname, "save-range")==0) {
+          if (data.frange) fclose(data.frange);
           data.frange=fopen_utf8(optarg,"w");
           save_cmd=0;
           if (data.frange==NULL) {