소스 검색

convert to zalloc

tags/v0.9.3
Holger Lubitz 18 년 전
부모
커밋
389c63d7c4
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1
    2
      src/net/udp.c

+ 1
- 2
src/net/udp.c 파일 보기

104
 	int rc;
104
 	int rc;
105
 
105
 
106
 	/* Allocate and initialise structure */
106
 	/* Allocate and initialise structure */
107
-	udp = malloc ( sizeof ( *udp ) );
107
+	udp = zalloc ( sizeof ( *udp ) );
108
 	if ( ! udp )
108
 	if ( ! udp )
109
 		return -ENOMEM;
109
 		return -ENOMEM;
110
 	DBGC ( udp, "UDP %p allocated\n", udp );
110
 	DBGC ( udp, "UDP %p allocated\n", udp );
111
-	memset ( udp, 0, sizeof ( *udp ) );
112
 	xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt );
111
 	xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt );
113
 	memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
112
 	memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
114
 
113
 

Loading…
취소
저장