From 65a4abb24b3cc40d1ab0e913cc1afab738418906 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Fri, 1 Jun 2018 08:25:30 +0930 Subject: [PATCH] rtmp: remove unused allocation and copy --- rtmp/rtmp.c | 6 ------ 1 file changed, 6 deletions(-) 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; }