mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 10:40:19 -04:00
test strdup() failures.
from: Chris Faulhaber <jedgar@fxp.org> Obtained from: KAME
This commit is contained in:
parent
f315dbdbd4
commit
effd2d8296
1 changed files with 7 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue