From owner-p4-projects@FreeBSD.ORG Thu Jul 16 23:13:10 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 354E81065676; Thu, 16 Jul 2009 23:13:10 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E54ED1065674 for ; Thu, 16 Jul 2009 23:13:09 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D34B98FC17 for ; Thu, 16 Jul 2009 23:13:09 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6GND9bA051361 for ; Thu, 16 Jul 2009 23:13:09 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6GND9Jt051359 for perforce@freebsd.org; Thu, 16 Jul 2009 23:13:09 GMT (envelope-from pgj@FreeBSD.org) Date: Thu, 16 Jul 2009 23:13:09 GMT Message-Id: <200907162313.n6GND9Jt051359@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pgj@FreeBSD.org using -f From: Gabor Pali To: Perforce Change Reviews Cc: Subject: PERFORCE change 166183 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2009 23:13:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=166183 Change 166183 by pgj@petymeg-current on 2009/07/16 23:12:28 Fix socket_type_list iterator routines. Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#29 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#29 (text+ko) ==== @@ -278,7 +278,7 @@ /* XXX: Should it copy the list? */ itp->sti_list = list; itp->sti_first = LIST_FIRST(&list->stl_list); - itp->sti_next = itp->sti_first; + itp->sti_next = LIST_NEXT(itp->sti_first, st_list); *iterator = itp; return (0); } @@ -310,14 +310,9 @@ stp = malloc(sizeof(*stp)); if (stp == NULL) return (NULL); - - iterator->sti_next = LIST_NEXT(iterator->sti_next, st_list); - if (iterator->sti_next == NULL) { - free(stp); - return (NULL); - } memcpy(stp, iterator->sti_next, sizeof(*stp)); + iterator->sti_next = LIST_NEXT(iterator->sti_next, st_list); return (stp); }