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 {