aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index c55ebbb09..740daaffb 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -248,7 +248,7 @@ int main(int argc, char *argv[])
248 switch (c) { 248 switch (c) {
249 case 'c': 249 case 'c':
250 len = strlen(optarg) > 255 ? 255 : strlen(optarg); 250 len = strlen(optarg) > 255 ? 255 : strlen(optarg);
251 free(client_config.clientid); 251 if (client_config.clientid) free(client_config.clientid);
252 client_config.clientid = xmalloc(len + 2); 252 client_config.clientid = xmalloc(len + 2);
253 client_config.clientid[OPT_CODE] = DHCP_CLIENT_ID; 253 client_config.clientid[OPT_CODE] = DHCP_CLIENT_ID;
254 client_config.clientid[OPT_LEN] = len; 254 client_config.clientid[OPT_LEN] = len;
@@ -264,7 +264,7 @@ int main(int argc, char *argv[])
264 case 'h': 264 case 'h':
265 case 'H': 265 case 'H':
266 len = strlen(optarg) > 255 ? 255 : strlen(optarg); 266 len = strlen(optarg) > 255 ? 255 : strlen(optarg);
267 free(client_config.hostname); 267 if (client_config.hostname) free(client_config.hostname);
268 client_config.hostname = xmalloc(len + 2); 268 client_config.hostname = xmalloc(len + 2);
269 client_config.hostname[OPT_CODE] = DHCP_HOST_NAME; 269 client_config.hostname[OPT_CODE] = DHCP_HOST_NAME;
270 client_config.hostname[OPT_LEN] = len; 270 client_config.hostname[OPT_LEN] = len;