summaryrefslogtreecommitdiff
path: root/networking/udhcp
diff options
context:
space:
mode:
authorRob Landley2006-03-01 16:39:45 +0000
committerRob Landley2006-03-01 16:39:45 +0000
commite7c43b66d74ee9902a6732122788a7a16bcfbf18 (patch)
treeebb8583e9e1265588592614c0b4878daded44125 /networking/udhcp
parent93f2286e6e59dab5eed14b5912a79254031c5a62 (diff)
downloadbusybox-e7c43b66d74ee9902a6732122788a7a16bcfbf18.zip
busybox-e7c43b66d74ee9902a6732122788a7a16bcfbf18.tar.gz
Cleanup patch from Denis Vlasenko. Mostly variants of removing the if(x)
from before "if(x) free(x)".
Diffstat (limited to 'networking/udhcp')
-rw-r--r--networking/udhcp/dhcpc.c8
-rw-r--r--networking/udhcp/files.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index e035bd4..7e7f94a 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -217,7 +217,7 @@ int main(int argc, char *argv[])
case 'c':
if (no_clientid) show_usage();
len = strlen(optarg) > 255 ? 255 : strlen(optarg);
- if (client_config.clientid) free(client_config.clientid);
+ free(client_config.clientid);
client_config.clientid = xmalloc(len + 2);
client_config.clientid[OPT_CODE] = DHCP_CLIENT_ID;
client_config.clientid[OPT_LEN] = len;
@@ -230,7 +230,7 @@ int main(int argc, char *argv[])
break;
case 'V':
len = strlen(optarg) > 255 ? 255 : strlen(optarg);
- if (client_config.vendorclass) free(client_config.vendorclass);
+ free(client_config.vendorclass);
client_config.vendorclass = xmalloc(len + 2);
client_config.vendorclass[OPT_CODE] = DHCP_VENDOR;
client_config.vendorclass[OPT_LEN] = len;
@@ -245,7 +245,7 @@ int main(int argc, char *argv[])
case 'h':
case 'H':
len = strlen(optarg) > 255 ? 255 : strlen(optarg);
- if (client_config.hostname) free(client_config.hostname);
+ free(client_config.hostname);
client_config.hostname = xmalloc(len + 2);
client_config.hostname[OPT_CODE] = DHCP_HOST_NAME;
client_config.hostname[OPT_LEN] = len;
@@ -253,7 +253,7 @@ int main(int argc, char *argv[])
break;
case 'F':
len = strlen(optarg) > 255 ? 255 : strlen(optarg);
- if (client_config.fqdn) free(client_config.fqdn);
+ free(client_config.fqdn);
client_config.fqdn = xmalloc(len + 5);
client_config.fqdn[OPT_CODE] = DHCP_FQDN;
client_config.fqdn[OPT_LEN] = len + 3;
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c
index 01534f2..416b1fe 100644
--- a/networking/udhcp/files.c
+++ b/networking/udhcp/files.c
@@ -62,7 +62,7 @@ static int read_str(const char *line, void *arg)
{
char **dest = arg;
- if (*dest) free(*dest);
+ free(*dest);
*dest = strdup(line);
return 1;