diff --git a/rtmp/RTMPWrapper.c b/rtmp/RTMPWrapper.c index 1919a8ab..f63e76d7 100644 --- a/rtmp/RTMPWrapper.c +++ b/rtmp/RTMPWrapper.c @@ -70,14 +70,17 @@ unsigned int RTMP_write_frame(char* data, uint data_length){ if (!RTMP_IsConnected(rtmp)) { printf("RTMP is not connected!\n"); free(dataForC); + free(data); return 0; } if (!RTMP_Write(rtmp, (const char*)data, data_length)) { printf("RTMP write error!\n"); free(dataForC); + free(data); return 0; } free(dataForC); + free(data); return 1; }