]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW anal cleanup
authorwessels <>
Wed, 2 Dec 1998 12:57:52 +0000 (12:57 +0000)
committerwessels <>
Wed, 2 Dec 1998 12:57:52 +0000 (12:57 +0000)
src/snmp_core.cc

index 59bfb9593e3e4d4ede37559e15ef5884fd1e940c..6672038bab02b4df38e280b73412fd58ab8a0bb4 100644 (file)
@@ -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;
 }
 
 /*