From 66cdea021ce9944bc8051c5cfa4e3c3f68cdeab8 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Wed, 12 Sep 2018 15:38:05 +0930 Subject: [PATCH] rtmp: remove incorrect and redundant calloc implementation --- rtmp/rtmp.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 1526dac7..e475e1f1 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -200,7 +200,7 @@ func C_RTMPPacket_Alloc(p *C_RTMPPacket, nSize uint32) (ok bool) { return 0 } */ - ptr = (*byte)(calloc(1, uintptr(nSize+RTMP_MAX_HEADER_SIZE))) + ptr = (*byte)(malloc(uintptr(nSize + RTMP_MAX_HEADER_SIZE))) if ptr == nil { return false @@ -2110,12 +2110,6 @@ func malloc(nOfBytes uintptr) unsafe.Pointer { return unsafe.Pointer(&mem[0]) } -func calloc(val byte, noOfBytes uintptr) unsafe.Pointer { - mem := malloc(noOfBytes) - memset((*byte)(mem), val, int(noOfBytes)) - return mem -} - // incBytePtr returns an unsafe.Pointer to a byte that is inc positive positions // from the passed ptr func incBytePtr(ptr unsafe.Pointer, inc int) unsafe.Pointer {