summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2006-04-19 17:19:46 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2006-04-19 17:19:46 +0000
commit7ced3ff58d2bdf54f036d03a3edc1369cab76e46 (patch)
treee49c211d872264f3c080acc63cf00e167b6d20bd
parent9cbc51610e6f3a5219e4131f6929284d76f34c8c (diff)
small cleanup: no need to strdup here.
-rw-r--r--sbin/ipsecctl/parse.y11
1 files changed, 3 insertions, 8 deletions
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y
index ecca830ffe2..27f86f639fd 100644
--- a/sbin/ipsecctl/parse.y
+++ b/sbin/ipsecctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.60 2006/04/19 16:10:50 hshoexer Exp $ */
+/* $OpenBSD: parse.y,v 1.61 2006/04/19 17:19:45 hshoexer Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1288,15 +1288,10 @@ struct ipsec_addr_wrap *
host_if(const char *s, int mask)
{
struct ipsec_addr_wrap *ipa = NULL;
- char *ps;
- if ((ps = strdup(s)) == NULL)
- err(1, "host_if: strdup");
+ if (ifa_exists(s))
+ ipa = ifa_lookup(s);
- if (ifa_exists(ps))
- ipa = ifa_lookup(ps);
-
- free(ps);
return (ipa);
}