Преглед на файлове

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;