+/** @file\r
+ Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials are licensed and made available\r
+ under the terms and conditions of the BSD License which accompanies this\r
+ distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php.\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
/*\r
* Copyright (c) 1996 by Internet Software Consortium.\r
*\r
res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {\r
ns_updrec *rrecp_start = rrecp_in;\r
HEADER *hp;\r
- u_char *cp, *sp1, *sp2, *startp, *endp;\r
+ u_char *cp, *sp2, *startp, *endp;\r
int n, i, soanum, multiline;\r
ns_updrec *rrecp;\r
struct in_addr ina;\r
hp->id = htons(++_res.id);\r
hp->opcode = ns_o_update;\r
hp->rcode = NOERROR;\r
- sp1 = buf + 2*INT16SZ; /* save pointer to zocount */\r
cp = buf + HFIXEDSZ;\r
buflen -= HFIXEDSZ;\r
dpp = dnptrs;\r
u_int class, u_int type, u_long ttl) {\r
ns_updrec *rrecp = (ns_updrec *)calloc(1, sizeof(ns_updrec));\r
\r
- if (!rrecp || !(rrecp->r_dname = strdup(dname)))\r
+ if (!rrecp || !(rrecp->r_dname = strdup(dname))) {\r
+ free(rrecp);\r
return (NULL);\r
+ }\r
rrecp->r_class = (u_int16_t)class;\r
rrecp->r_type = (u_int16_t)type;\r
rrecp->r_ttl = (u_int32_t)ttl;\r