diff options
| author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2000-12-11 18:47:39 +0000 |
|---|---|---|
| committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2000-12-11 18:47:39 +0000 |
| commit | 2aa7c31cc94453e43a1d4d717ddacb07f6943a7b (patch) | |
| tree | 12fe73e36837fdf3fc372c4e75fd52cc3932c9e4 /sbin/ping6 | |
| parent | 2a534711d39f992a82af041a9c87f08b120fbedf (diff) | |
Notes
Diffstat (limited to 'sbin/ping6')
| -rw-r--r-- | sbin/ping6/ping6.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index f85353447227..3d529b649928 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -444,11 +444,13 @@ main(argc, argv) #ifdef IPSEC_POLICY_IPSEC case 'P': options |= F_POLICY; - if (!strncmp("in", optarg, 2)) - policy_in = strdup(optarg); - else if (!strncmp("out", optarg, 3)) - policy_out = strdup(optarg); - else + if (!strncmp("in", optarg, 2)) { + if ((policy_in = strdup(optarg)) == NULL) + errx(1, "strdup"); + } else if (!strncmp("out", optarg, 3)) { + if ((policy_out = strdup(optarg)) == NULL) + errx(1, "strdup"); + } else errx(1, "invalid security policy"); break; #else |
