shithub: libopusenc

Download patch

ref: bb30efe94c5945cdeefea1b0af73679623a53994
parent: a852e9fbfd7c360e9078d124e73ec6eef2665148
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Thu Sep 27 06:06:23 EDT 2018

Don't leak comments on failure in opusenc_example.c

--- a/examples/opusenc_example.c
+++ b/examples/opusenc_example.c
@@ -22,7 +22,8 @@
   ope_comments_add(comments, "TITLE", "Some track");
   enc = ope_encoder_create_file(argv[2], comments, 44100, 2, 0, &error);
   if (!enc) {
-    fprintf(stderr, "cannout open output file: %s\n", argv[2]);
+    fprintf(stderr, "error encoding to file %s: %s\n", argv[2], ope_strerror(error));
+    ope_comments_destroy(comments);
     fclose(fin);
     return 1;
   }