Commit 654b537c authored by lucabe's avatar lucabe

Fix an use-after-free bug


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8759 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0b752e7a
...@@ -3062,6 +3062,7 @@ static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPHeader *h) ...@@ -3062,6 +3062,7 @@ static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPHeader *h)
static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h) static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h)
{ {
HTTPContext *rtp_c; HTTPContext *rtp_c;
char session_id[32];
rtp_c = find_rtp_session_with_url(url, h->session_id); rtp_c = find_rtp_session_with_url(url, h->session_id);
if (!rtp_c) { if (!rtp_c) {
...@@ -3069,13 +3070,15 @@ static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h) ...@@ -3069,13 +3070,15 @@ static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h)
return; return;
} }
pstrcpy(session_id, sizeof(session_id), rtp_c->session_id);
/* abort the session */ /* abort the session */
close_connection(rtp_c); close_connection(rtp_c);
/* now everything is OK, so we can send the connection parameters */ /* now everything is OK, so we can send the connection parameters */
rtsp_reply_header(c, RTSP_STATUS_OK); rtsp_reply_header(c, RTSP_STATUS_OK);
/* session ID */ /* session ID */
url_fprintf(c->pb, "Session: %s\r\n", rtp_c->session_id); url_fprintf(c->pb, "Session: %s\r\n", session_id);
url_fprintf(c->pb, "\r\n"); url_fprintf(c->pb, "\r\n");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment