From: wessels <> Date: Wed, 2 Dec 1998 12:57:52 +0000 (+0000) Subject: DW anal cleanup X-Git-Tag: SQUID_3_0_PRE1~2486 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5898ce23bc0cf6f72806dc4dc9917f4812ed6feb;p=thirdparty%2Fsquid.git DW anal cleanup --- diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 59bfb9593e..6672038bab 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1,5 +1,5 @@ -/* - * $Id: snmp_core.cc,v 1.21 1998/12/02 05:51:00 wessels Exp $ +* + * $Id: snmp_core.cc,v 1.22 1998/12/02 05:57:52 wessels Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -540,7 +540,7 @@ snmpHandleUdp(int sock, void *not_used) snmp_rq->len = len; snmp_rq->sock = sock; snmp_rq->outbuf = xmalloc(snmp_rq->outlen = SNMP_REQUEST_SIZE); - memcpy(&snmp_rq->from, &from, sizeof(struct sockaddr_in)); + xmemcpy(&snmp_rq->from, &from, sizeof(struct sockaddr_in)); snmpDecodePacket(snmp_rq); xfree(snmp_rq); } else { @@ -564,7 +564,7 @@ snmpDecodePacket(snmp_request_t * rq) debug(49, 5) ("snmpDecodePacket: Called.\n"); /* Now that we have the data, turn it into a PDU */ - Session = (struct snmp_session *) xmalloc(sizeof(struct snmp_session)); + Session = xmalloc(sizeof(struct snmp_session)); Session->Version = SNMP_VERSION_1; Session->authenticator = NULL; Session->community = (u_char *) xstrdup("public"); @@ -979,17 +979,14 @@ snmpCreateOid(va_alist) } /* - * Allocate space for, and copy, an OID. Returns new oid, or NULL. + * Allocate space for, and copy, an OID. Returns new oid. */ oid * snmpOidDup(oid * A, snint ALen) { - oid *Ans; - - Ans = (oid *) xmalloc(sizeof(oid) * ALen); - if (Ans) - memcpy(Ans, A, (sizeof(oid) * ALen)); - return (Ans); + oid *Ans = xmalloc(sizeof(oid) * ALen); + xmemcpy(Ans, A, (sizeof(oid) * ALen)); + return Ans; } /*