diff options
Diffstat (limited to 'usr.sbin/dhcp')
-rw-r--r-- | usr.sbin/dhcp/dhclient/dhclient.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/dhcp/dhclient/dhclient.c b/usr.sbin/dhcp/dhclient/dhclient.c index 959bd444e00..bc69b24eae4 100644 --- a/usr.sbin/dhcp/dhclient/dhclient.c +++ b/usr.sbin/dhcp/dhclient/dhclient.c @@ -2028,8 +2028,9 @@ void script_init (ip, reason, medium) { if (ip) { ip->client->scriptEnvsize = 100; - ip->client->scriptEnv = malloc(ip->client->scriptEnvsize - * sizeof(char *)); + if (ip->client->scriptEnv == NULL) + ip->client->scriptEnv = + malloc(ip->client->scriptEnvsize * sizeof(char *)); if (ip->client->scriptEnv == NULL) error ("script_init: no memory for environment initialization"); |