avcodec/utils: Fix memleak on error in convert_sub_to_old_ass_form()
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 5 Mar 2016 00:38:58 +0000 (01:38 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 5 Mar 2016 00:50:32 +0000 (01:50 +0100)
Fixes CID1355116

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/utils.c

index b993899..bbb9804 100644 (file)
@@ -2517,6 +2517,7 @@ static int convert_sub_to_old_ass_form(AVSubtitle *sub, const AVPacket *pkt, AVR
 
         final_dialog = av_strdup(buf.str);
         if (!av_bprint_is_complete(&buf) || !final_dialog) {
+            av_freep(&final_dialog);
             av_bprint_finalize(&buf, NULL);
             return AVERROR(ENOMEM);
         }