소스 검색

bug fix: multiply allocation count by sizeof route_entry

Eugene Yakubovich 10 년 전
부모
커밋
c7734b0394
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      udp/proxy.c

+ 1 - 1
udp/proxy.c

@@ -157,7 +157,7 @@ static int set_route(struct ip_net dst, struct sockaddr_in *next_hop) {
 
 	if( routes_alloc == routes_cnt ) {
 		int new_alloc = (routes_alloc ? 2*routes_alloc : 8);
-		struct route_entry *new_routes = (struct route_entry *) realloc(routes, new_alloc);
+		struct route_entry *new_routes = (struct route_entry *) realloc(routes, new_alloc*sizeof(struct route_entry));
 		if( !new_routes )
 			return ENOMEM;