
Again, a simple example of how code reviews can assist in defect detection. Now
let’s look at something a little more complex. One thing to keep in mind as you are
looking at these code samples is that for a code review, this sample is a little short,
but the idea is still there. Usually, it is more helpful when the code is long, and that
is how developers tend to miss things because they get lost in the details.
#include <stdlib.h> /* For _MAX_PATH definition */
#include <stdio.h>
#include <malloc.h>
void main( void )
{
char *string;
/* Allocate space for a path name */
string = malloc( _MAX_PATH );
if( string == NULL )
printf( "Insufficient memory available\n" ...