diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-04-05 20:59:50 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-04-05 20:59:50 +0000 |
commit | b1aa8448f2f49706ad70293b26895ed671bc485a (patch) | |
tree | 8e5364f305b4dcf8e84dd42a056317e15c6520d7 /sbin/isakmpd/if.c | |
parent | ca8e22626479704bbc764eef4cd7a15c3ed99af5 (diff) |
Merge with EOM 1.11
We need log.h
Plug memleak
1999 copyrights
Diffstat (limited to 'sbin/isakmpd/if.c')
-rw-r--r-- | sbin/isakmpd/if.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sbin/isakmpd/if.c b/sbin/isakmpd/if.c index 6fbe8f99e97..ff1edb0d855 100644 --- a/sbin/isakmpd/if.c +++ b/sbin/isakmpd/if.c @@ -1,8 +1,8 @@ -/* $OpenBSD: if.c,v 1.5 1999/03/02 15:12:00 niklas Exp $ */ -/* $EOM: if.c,v 1.8 1999/03/02 14:26:12 niklas Exp $ */ +/* $OpenBSD: if.c,v 1.6 1999/04/05 20:59:49 niklas Exp $ */ +/* $EOM: if.c,v 1.11 1999/04/05 18:26:30 niklas Exp $ */ /* - * Copyright (c) 1998 Niklas Hallqvist. All rights reserved. + * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,6 +43,7 @@ #include "sysdep.h" +#include "log.h" #include "if.h" /* XXX Unsafe if either x or y has side-effects. */ @@ -78,7 +79,10 @@ siocgifconf (struct ifconf *ifcp) ifcp->ifc_len = len; new_buf = realloc (buf, len); if (!new_buf) - goto err; + { + log_error ("siocgifconf: realloc (%p, %d) failed", buf, len); + goto err; + } ifcp->ifc_buf = buf = new_buf; if (ioctl (s, SIOCGIFCONF, ifcp) == -1) goto err; @@ -124,5 +128,6 @@ if_map (void (*func) (struct ifreq *, void *), void *arg) + MAX (ifrp->ifr_addr.sa_len, sizeof ifrp->ifr_addr); #endif } + free (ifc.ifc_buf); return 0; } |