Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2008 21:38:08 GMT
From:      Vincenzo Iozzo <snagg@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 142603 for review
Message-ID:  <200805302138.m4ULc8Pa099996@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}	
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805302138.m4ULc8Pa099996>