summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2013-12-03 23:10:21 +0000
committerRoy Marples <roy@marples.name>2013-12-03 23:10:21 +0000
commitb7f5d1db5ba84809c9fb1d905ea428fc8f56ba0c (patch)
treef4ae54ae6466674fe6a303b04e12a7f7ab1a54eb /dhcpcd.c
parent034768814a3b3610b8168a586c1e6c86c8c79a05 (diff)
downloaddhcpcd-b7f5d1db5ba84809c9fb1d905ea428fc8f56ba0c.tar.xz
Fix a few memory leaks, DHCPv6 prefix definition and the -V option.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 5288ed7c..193c9a1a 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1155,21 +1155,8 @@ main(int argc, char **argv)
i = 2;
break;
case 'V':
- printf("Interface options:\n");
- if_printoptions();
-#ifdef INET
- if (family == 0 || family == AF_INET) {
- printf("\nDHCPv4 options:\n");
- dhcp_printoptions();
- }
-#endif
-#ifdef INET6
- if (family == 0 || family == AF_INET6) {
- printf("\nDHCPv6 options:\n");
- dhcp6_printoptions();
- }
-#endif
- exit(EXIT_SUCCESS);
+ i = 3;
+ break;
case '?':
usage();
exit(EXIT_FAILURE);
@@ -1185,6 +1172,26 @@ main(int argc, char **argv)
usage();
exit(EXIT_FAILURE);
}
+ if (i == 3) {
+ printf("Interface options:\n");
+ if_printoptions();
+#ifdef INET
+ if (family == 0 || family == AF_INET) {
+ printf("\nDHCPv4 options:\n");
+ dhcp_printoptions();
+ }
+#endif
+#ifdef INET6
+ if (family == 0 || family == AF_INET6) {
+ printf("\nDHCPv6 options:\n");
+ dhcp6_printoptions();
+ }
+#endif
+#ifdef DEBUG_MEMORY
+ cleanup();
+#endif
+ exit(EXIT_SUCCESS);
+ }
options = if_options->options;
if (i != 0) {
if (i == 1)