if( request == NULL )
return 0;
- char* original_request = strdup( request );
- char** words = calloc(COMMAND_BUFSIZE, sizeof(char*));
+ char* original_request = strdup( request );
+ char* words[COMMAND_BUFSIZE];
int ret_val = 0;
int i = 0;
if( cur_tok == NULL )
{
free( original_request );
- free( words );
return 0;
}
} else {
fprintf( stderr, "Too many tokens in command\n" );
free( original_request );
- free( words );
return 1;
}
}
ret_val = 1;
}
+ free( original_request );
if(!ret_val)
- ret_val = parse_error( words );
+ return parse_error( words );
else
- ret_val = 1;
-
- free( original_request );
- free( words );
- return ret_val;
+ return 1;
}