do not cuase crash in dhcp when no networkcard is found

svn path=/trunk/; revision=22200
This commit is contained in:
Magnus Olsen 2006-06-03 20:29:26 +00:00
parent dd6d911c37
commit c92839403a

View file

@ -98,10 +98,19 @@ void *dmalloc( int size, char *name ) { return malloc( size ); }
int read_client_conf(void) {
/* What a strage dance */
struct client_config *config = ifi->client->config;
struct client_config *config;
char ComputerName [MAX_COMPUTERNAME_LENGTH + 1];
DWORD ComputerNameSize = sizeof ComputerName / sizeof ComputerName[0];
if ((ifi!= NULL) && (ifi->client->config != NULL))
config = ifi->client->config;
else
{
warn("util.c read_client_conf poorly implemented!");
return 0;
}
GetComputerName(ComputerName, & ComputerNameSize);
/* This never gets freed since it's only called once */
LPSTR lpCompName =