Use the return codes of nwrap_add_hname() and nwrap_add_ai().
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
char *n;
char *ip;
+ bool ok;
struct nwrap_entdata *ed = (struct nwrap_entdata *)
malloc(sizeof(struct nwrap_entdata));
ed->aliases_count = aliases_count;
/* Inventarize item */
- nwrap_add_hname(ed);
- nwrap_add_ai(ip, ed);
+ ok = nwrap_add_hname(ed);
+ if (!ok) {
+ return false;
+ }
+
+ ok = nwrap_add_ai(ip, ed);
+ if (!ok) {
+ return false;
+ }
nwrap_he->num++;
return true;