diff --git a/rtmp/rtmp.c b/rtmp/rtmp.c index 26aa44e0..c3a335e6 100644 --- a/rtmp/rtmp.c +++ b/rtmp/rtmp.c @@ -65,22 +65,16 @@ RTMP* start_session(RTMP* rtmp, char* url, uint connect_timeout) { } unsigned int write_frame(RTMP* rtmp, char* data, uint data_length) { - char* dataForC = malloc(data_length); - memcpy(dataForC,data,data_length); if (!RTMP_IsConnected(rtmp)) { printf("RTMP is not connected!\n"); - free(dataForC); return 1; } if (!RTMP_Write(rtmp, (const char*)data, data_length)) { printf("RTMP write error!\n"); - free(dataForC); return 1; } - free(dataForC); - return 0; }