winlin

fix bug of mem leak, free the left msgs if send error

@@ -493,7 +493,7 @@ int SrsEdgeForwarder::cycle() @@ -493,7 +493,7 @@ int SrsEdgeForwarder::cycle()
493 493
494 if ((ret = client->send_and_free_message(msg)) != ERROR_SUCCESS) { 494 if ((ret = client->send_and_free_message(msg)) != ERROR_SUCCESS) {
495 srs_error("edge publish forwarder send message to server failed. ret=%d", ret); 495 srs_error("edge publish forwarder send message to server failed. ret=%d", ret);
496 - break; 496 + continue;
497 } 497 }
498 } 498 }
499 // free the array itself. 499 // free the array itself.
@@ -371,7 +371,7 @@ int SrsForwarder::forward() @@ -371,7 +371,7 @@ int SrsForwarder::forward()
371 371
372 if ((ret = client->send_and_free_message(msg)) != ERROR_SUCCESS) { 372 if ((ret = client->send_and_free_message(msg)) != ERROR_SUCCESS) {
373 srs_error("forwarder send message to server failed. ret=%d", ret); 373 srs_error("forwarder send message to server failed. ret=%d", ret);
374 - break; 374 + continue;
375 } 375 }
376 } 376 }
377 // free the array itself. 377 // free the array itself.
@@ -543,7 +543,7 @@ int SrsRtmpConn::playing(SrsSource* source) @@ -543,7 +543,7 @@ int SrsRtmpConn::playing(SrsSource* source)
543 543
544 if ((ret = rtmp->send_and_free_message(msg)) != ERROR_SUCCESS) { 544 if ((ret = rtmp->send_and_free_message(msg)) != ERROR_SUCCESS) {
545 srs_error("send message to client failed. ret=%d", ret); 545 srs_error("send message to client failed. ret=%d", ret);
546 - break; 546 + continue;
547 } 547 }
548 } 548 }
549 // free the array itself. 549 // free the array itself.