winlin

fix bug of shared ptr, must copy the payload for it free it.

@@ -1373,7 +1373,10 @@ int SrsSharedPtrMessage::initialize(ISrsMessage* msg, char* payload, int size) @@ -1373,7 +1373,10 @@ int SrsSharedPtrMessage::initialize(ISrsMessage* msg, char* payload, int size)
1373 header.payload_length = size; 1373 header.payload_length = size;
1374 1374
1375 ptr = new SrsSharedPtr(); 1375 ptr = new SrsSharedPtr();
1376 - ptr->payload = payload; 1376 +
  1377 + // should copy the payload once
  1378 + ptr->payload = new char[size];
  1379 + memcpy(ptr->payload, payload, size);
1377 ptr->size = size; 1380 ptr->size = size;
1378 1381
1379 if (msg->header.is_video()) { 1382 if (msg->header.is_video()) {