From 9ba786d1aaea9220c3571dc973a7b15f6dc0e729 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 13 May 2014 14:32:50 +0800 Subject: [PATCH] fix bug of mem leak, free the left msgs if send error --- trunk/src/app/srs_app_edge.cpp | 2 +- trunk/src/app/srs_app_forward.cpp | 2 +- trunk/src/app/srs_app_rtmp_conn.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp index 06c822500..c2d330757 100644 --- a/trunk/src/app/srs_app_edge.cpp +++ b/trunk/src/app/srs_app_edge.cpp @@ -493,7 +493,7 @@ int SrsEdgeForwarder::cycle() if ((ret = client->send_and_free_message(msg)) != ERROR_SUCCESS) { srs_error("edge publish forwarder send message to server failed. ret=%d", ret); - break; + continue; } } // free the array itself. diff --git a/trunk/src/app/srs_app_forward.cpp b/trunk/src/app/srs_app_forward.cpp index 45a35d0b8..deae8c178 100644 --- a/trunk/src/app/srs_app_forward.cpp +++ b/trunk/src/app/srs_app_forward.cpp @@ -371,7 +371,7 @@ int SrsForwarder::forward() if ((ret = client->send_and_free_message(msg)) != ERROR_SUCCESS) { srs_error("forwarder send message to server failed. ret=%d", ret); - break; + continue; } } // free the array itself. diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 6e0810eb1..611c71f8f 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -543,7 +543,7 @@ int SrsRtmpConn::playing(SrsSource* source) if ((ret = rtmp->send_and_free_message(msg)) != ERROR_SUCCESS) { srs_error("send message to client failed. ret=%d", ret); - break; + continue; } } // free the array itself.