diff options
Diffstat (limited to 'contrib/ipfilter/ipfs.c')
-rw-r--r-- | contrib/ipfilter/ipfs.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/ipfilter/ipfs.c b/contrib/ipfilter/ipfs.c index a2ccf89..0e864f7 100644 --- a/contrib/ipfilter/ipfs.c +++ b/contrib/ipfilter/ipfs.c @@ -45,7 +45,7 @@ #include "ipf.h" #if !defined(lint) -static const char rcsid[] = "@(#)$Id: ipfs.c,v 2.6.2.9 2002/04/17 17:42:59 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: ipfs.c,v 2.6.2.11 2002/06/04 14:44:05 darrenr Exp $"; #endif #ifndef IPF_SAVEDIR @@ -733,16 +733,16 @@ char *dirname; devfd = opendevice(IPL_STATE); if (devfd == -1) - return 1; + goto bad; if (writestate(devfd, NULL)) - return 1; + goto bad; close(devfd); devfd = opendevice(IPL_NAT); if (devfd == -1) - return 1; + goto bad; if (writenat(devfd, NULL)) - return 1; + goto bad; close(devfd); if (setlock(fd, 0)) { @@ -751,6 +751,11 @@ char *dirname; } return 0; + +bad: + setlock(fd, 0); + close(fd); + return 1; } |