Date: Wed, 5 Aug 2009 19:56:29 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 167050 for review Message-ID: <200908051956.n75JuTlT093589@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167050 Change 167050 by rwatson@rwatson_cinnamon on 2009/08/05 19:55:43 Fix warnings. Affected files ... .. //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.c#7 edit Differences ... ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.c#7 (text+ko) ==== @@ -171,7 +171,7 @@ int nbytes = 0; /*Remaining bytes */ struct bsm_rec_hdr *audit_slice_dev_buf; struct audit_slice *as; - void *as_rec; + void *as_rec = NULL; as = dev->si_drv1; @@ -204,7 +204,7 @@ * longer than MAX_AUDIT_RECORD_SIZE, or less than * sizeof(*audit_slice_dev_buf). */ - recsz = be32dec (audit_slice_dev_buf->rec_byte_count); + recsz = be32toh(audit_slice_dev_buf->rec_byte_count); as_rec = (void *)malloc((unsigned long)recsz, M_AUDITBSM, M_WAITOK | M_ZERO); @@ -224,7 +224,8 @@ * XXXRW: Only free as_rec if we allocated it. */ free(audit_slice_dev_buf, M_TEMP); - free(as_rec, M_AUDITBSM); + if (as_rec != NULL) + free(as_rec, M_AUDITBSM); return (error); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908051956.n75JuTlT093589>