diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-02-05 13:33:23 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-02-05 13:33:23 +0000 |
commit | 49c32ce0a422a8caf79ed35191dc2c93ee23ffb4 (patch) | |
tree | 6c750340eb4e9ffd97b84d1e751706e0dc5aacb5 /sbin | |
parent | 5fe4602bad80ab1a487facf7db287d7e0e42b122 (diff) |
plug memory leak; PR3668 Emil Mikulic <emikulic@dmr.ath.cx>
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhclient.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 7d0133ff1d4..c48cd70a21a 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.3 2004/02/04 12:16:56 henning Exp $ */ +/* $OpenBSD: dhclient.c,v 1.4 2004/02/05 13:33:22 henning Exp $ */ /* DHCP Client. */ @@ -1931,8 +1931,9 @@ script_init(struct interface_info *ip, char *reason, struct string_list *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"); |