webmdashenc: Fix potential memory leak
authorVignesh Venkatasubramanian <vigneshv@google.com>
Mon, 20 Apr 2015 18:20:41 +0000 (11:20 -0700)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 20 Apr 2015 23:12:27 +0000 (01:12 +0200)
Fix potential memory leak in WebM DASH Muxer. This fixes coverity
scan CID 1295088.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/webmdashenc.c

index a8eb8ac..6b94e54 100644 (file)
@@ -398,8 +398,8 @@ static int write_adaptation_set(AVFormatContext *s, int as_index)
         ret = write_representation(s, s->streams[as->streams[i]],
                                    representation_id, !width_in_as,
                                    !height_in_as, !sample_rate_in_as);
-        if (ret) return ret;
         av_free(representation_id);
+        if (ret) return ret;
     }
     avio_printf(s->pb, "</AdaptationSet>\n");
     return 0;