avformat/rtsp: Don't free uninitialized AVBPrint
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 20 Apr 2020 01:31:56 +0000 (03:31 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 20 Apr 2020 16:16:24 +0000 (18:16 +0200)
Fixes Coverity ID 1462307.

Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Ross Nicholson <phunkyfish@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/rtsp.c

index 49f7644..0a64620 100644 (file)
@@ -2567,8 +2567,8 @@ static int rtp_read_header(AVFormatContext *s)
 fail_nobuf:
     ret = AVERROR(ENOMEM);
     av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for sdp-headers\n");
-fail:
     av_bprint_finalize(&sdp, NULL);
+fail:
     avcodec_parameters_free(&par);
     if (in)
         ffurl_close(in);