From 7ced3ff58d2bdf54f036d03a3edc1369cab76e46 Mon Sep 17 00:00:00 2001 From: Hans-Joerg Hoexer Date: Wed, 19 Apr 2006 17:19:46 +0000 Subject: small cleanup: no need to strdup here. --- sbin/ipsecctl/parse.y | 11 +++-------- 1 file 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 @@ -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); } -- cgit v1.2.3