From owner-p4-projects@FreeBSD.ORG Fri May 30 21:38:09 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D2AF21065675; Fri, 30 May 2008 21:38:08 +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 946D61065673 for ; Fri, 30 May 2008 21:38:08 +0000 (UTC) (envelope-from snagg@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 69A758FC18 for ; Fri, 30 May 2008 21:38:08 +0000 (UTC) (envelope-from snagg@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4ULc8SY099998 for ; Fri, 30 May 2008 21:38:08 GMT (envelope-from snagg@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4ULc8Pa099996 for perforce@freebsd.org; Fri, 30 May 2008 21:38:08 GMT (envelope-from snagg@FreeBSD.org) Date: Fri, 30 May 2008 21:38:08 GMT Message-Id: <200805302138.m4ULc8Pa099996@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to snagg@FreeBSD.org using -f From: Vincenzo Iozzo To: Perforce Change Reviews Cc: Subject: PERFORCE change 142603 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: Fri, 30 May 2008 21:38:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=142603 Change 142603 by snagg@snagg_macosx on 2008/05/30 21:37:44 Fix a problem in the preselect_set Affected files ... .. //depot/projects/soc2008/snagg-audit/sys/security/audit/audit_pipe.c#20 edit Differences ... ==== //depot/projects/soc2008/snagg-audit/sys/security/audit/audit_pipe.c#20 (text) ==== @@ -358,8 +358,9 @@ */ KASSERT(num >= 0, ("Number of events is out of range")); app_new = malloc(sizeof(*app_new), M_AUDIT_PIPE_PRESELECT, M_WAITOK); - app_new->app_auevents= malloc(sizeof(struct audit_pipe_preselect_event) * - num, M_AUDIT_PIPE_PRESELECT_EVENT, M_WAITOK); + if(num) + app_new->app_auevents= malloc(sizeof(struct audit_pipe_preselect_event) * + num, M_AUDIT_PIPE_PRESELECT_EVENT, M_WAITOK); mtx_lock(&audit_pipe_mtx); @@ -398,7 +399,8 @@ mtx_unlock(&audit_pipe_mtx); if (app_new != NULL) { free(app_new, M_AUDIT_PIPE_PRESELECT); - free(app_new->app_auevents, M_AUDIT_PIPE_PRESELECT_EVENT); + if(num) + free(app_new->app_auevents, M_AUDIT_PIPE_PRESELECT_EVENT); } }