Skip to content

Commit

Permalink
fix memory leak at handshake. 2.0.213
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Sep 5, 2016
1 parent 1214af6 commit 6ec60b0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ Remark:

## History

* v2.0, 2016-09-05, fix memory leak at handshake. 2.0.213
* v2.0, 2016-09-04, support valgrind for [patched st](https://github.com/ossrs/state-threads/issues/2).
* v2.0, 2016-09-03, support all arm for [patched st](https://github.com/ossrs/state-threads/issues/1). 2.0.212
* v2.0, 2016-09-01, workaround [#511][bug #511] the fly stfd in close. 2.0.211
* v2.0, 2016-08-30, comment the pcr.
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 212
#define VERSION_REVISION 213

// generated by configure, only macros.
#include <srs_auto_headers.hpp>
Expand Down
9 changes: 8 additions & 1 deletion trunk/src/protocol/srs_rtmp_handshake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ namespace _srs_internal
}

SrsDH::~SrsDH()
{
close();
}

void SrsDH::close()
{
if (pdh != NULL) {
if (pdh->p != NULL) {
Expand Down Expand Up @@ -249,7 +254,9 @@ namespace _srs_internal
{
int ret = ERROR_SUCCESS;

int32_t bits_count = 1024;
int32_t bits_count = 1024;

close();

//1. Create the DH
if ((pdh = DH_new()) == NULL) {
Expand Down
2 changes: 2 additions & 0 deletions trunk/src/protocol/srs_rtmp_handshake.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ namespace _srs_internal
public:
SrsDH();
virtual ~SrsDH();
private:
virtual void close();
public:
/**
* initialize dh, generate the public and private key.
Expand Down

1 comment on commit 6ec60b0

@winlinvip
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.