summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1995-03-26 02:37:00 +0000
committerBill Paul <wpaul@FreeBSD.org>1995-03-26 02:37:00 +0000
commit7112864e5c58e33a263c9d0f7971b2f782588a87 (patch)
tree3ce2acad7614f2d1a40e98ec8daaf55b9ca4aa79
parent2adf028be345a9fa5324edd10d7a36ef89ca9562 (diff)
Notes
-rw-r--r--usr.sbin/rarpd/ether_addr.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/usr.sbin/rarpd/ether_addr.c b/usr.sbin/rarpd/ether_addr.c
index 87d5e700a2c5..7404c81b18e7 100644
--- a/usr.sbin/rarpd/ether_addr.c
+++ b/usr.sbin/rarpd/ether_addr.c
@@ -10,7 +10,7 @@
*
* Have a party.
*
- * $Id: ether_addr.c,v 1.2 1995/03/03 22:20:15 wpaul Exp $
+ * $Id: ether_addr.c,v 1.4 1995/03/05 22:03:58 wpaul Exp $
*/
@@ -119,13 +119,18 @@ int ether_ntohost(hostname, e)
return(1);
ether_a = ether_ntoa(e);
if (yp_match(yp_domain, "ethers.byaddr", ether_a,
- strlen(ether_a), &result, &resultlen))
+ strlen(ether_a), &result, &resultlen)) {
+ free(result);
return(1);
+ }
if (!ether_line(result, &local_ether, &local_host)) {
strcpy(hostname, (char *)&local_host);
+ free(result);
return(0);
- } else
+ } else {
+ free(result);
return(1);
+ }
}
if (!ether_line(&buf, &local_ether, &local_host)) {
if (!bcmp((char *)&local_ether.octet[0],
@@ -167,14 +172,19 @@ int ether_hostton(hostname, e)
if (yp_get_default_domain(&yp_domain))
return(1);
if (yp_match(yp_domain, "ethers.byname", hostname,
- strlen(hostname), &result, &resultlen))
+ strlen(hostname), &result, &resultlen)) {
+ free(result);
return(1);
+ }
if (!ether_line(result, &local_ether, &local_host)) {
bcopy((char *)&local_ether.octet[0],
(char *)&e->octet[0], 6);
+ free(result);
return(0);
- } else
+ } else {
+ free(result);
return(1);
+ }
}
if (!ether_line(&buf, &local_ether, &local_host)) {
if (!strcmp(hostname, (char *)&local_host)) {