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