From c92839403a72f508c6245e0ff7b73edabf82fb5a Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 3 Jun 2006 20:29:26 +0000 Subject: [PATCH] do not cuase crash in dhcp when no networkcard is found svn path=/trunk/; revision=22200 --- reactos/base/services/dhcp/util.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/reactos/base/services/dhcp/util.c b/reactos/base/services/dhcp/util.c index 098109535dd..c72a2b29819 100644 --- a/reactos/base/services/dhcp/util.c +++ b/reactos/base/services/dhcp/util.c @@ -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 =