diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 91a18d3770..619bc0f9db 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -2633,10 +2633,6 @@ force_timeout(dig_query_t *query) { event = isc_event_allocate(mctx, query, ISC_TIMEREVENT_IDLE, connect_timeout, query, sizeof(isc_event_t)); - if (event == NULL) { - fatal("isc_event_allocate: %s", - isc_result_totext(ISC_R_NOMEMORY)); - } isc_task_send(global_task, &event); /* diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c index e06f09c23c..56c85a0759 100644 --- a/bin/dnssec/dnssec-signzone.c +++ b/bin/dnssec/dnssec-signzone.c @@ -1570,8 +1570,6 @@ assignwork(isc_task_t *task, isc_task_t *worker) { sevent = (sevent_t *) isc_event_allocate(mctx, task, SIGNER_EVENT_WORK, sign, NULL, sizeof(sevent_t)); - if (sevent == NULL) - fatal("failed to allocate event\n"); sevent->node = node; sevent->fname = fname; @@ -1627,8 +1625,6 @@ sign(isc_task_t *task, isc_event_t *event) { wevent = (sevent_t *) isc_event_allocate(mctx, task, SIGNER_EVENT_WRITE, writenode, NULL, sizeof(sevent_t)); - if (wevent == NULL) - fatal("failed to allocate event\n"); wevent->node = node; wevent->fname = fname; isc_task_send(master, ISC_EVENT_PTR(&wevent)); diff --git a/bin/named/server.c b/bin/named/server.c index 53ed19a58e..9c3bd99e3c 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -2827,8 +2827,6 @@ catz_create_chg_task(dns_catz_entry_t *entry, dns_catz_zone_t *origin, event = (catz_chgzone_event_t *) isc_event_allocate(view->mctx, origin, type, action, NULL, sizeof(*event)); - if (event == NULL) - return (ISC_R_NOMEMORY); event->cbd = (catz_cb_data_t *) udata; event->entry = NULL; @@ -13565,8 +13563,6 @@ named_server_delzone(named_server_t *server, isc_lex_t *lex, dns_zone_attach(zone, &dz->zone); dzevent = isc_event_allocate(named_g_mctx, server, NAMED_EVENT_DELZONE, rmzone, dz, sizeof(isc_event_t)); - if (dzevent == NULL) - CHECK(ISC_R_NOMEMORY); dns_zone_gettask(zone, &task); isc_task_send(task, &dzevent); diff --git a/bin/tests/system/dyndb/driver/syncptr.c b/bin/tests/system/dyndb/driver/syncptr.c index 760e9c2c1b..dc917c5ab0 100644 --- a/bin/tests/system/dyndb/driver/syncptr.c +++ b/bin/tests/system/dyndb/driver/syncptr.c @@ -213,10 +213,6 @@ syncptr(sample_instance_t *inst, dns_name_t *name, SYNCPTR_WRITE_EVENT, syncptr_write, NULL, sizeof(syncptrevent_t)); - if (pevent == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup; - } isc_buffer_init(&pevent->b, pevent->buf, sizeof(pevent->buf)); dns_fixedname_init(&pevent->ptr_target_name); diff --git a/lib/dns/cache.c b/lib/dns/cache.c index 9a767aa0d3..a6cb99a505 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -556,20 +556,12 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr, DNS_EVENT_CACHECLEAN, incremental_cleaning_action, cleaner, sizeof(isc_event_t)); - if (cleaner->resched_event == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup; - } cleaner->overmem_event = isc_event_allocate(cache->mctx, cleaner, DNS_EVENT_CACHEOVERMEM, overmem_cleaning_action, cleaner, sizeof(isc_event_t)); - if (cleaner->overmem_event == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup; - } } return (ISC_R_SUCCESS); diff --git a/lib/dns/client.c b/lib/dns/client.c index 96d45093bb..dd37900a71 100644 --- a/lib/dns/client.c +++ b/lib/dns/client.c @@ -1342,10 +1342,6 @@ dns_client_startresolve(dns_client_t *client, const dns_name_t *name, event = (dns_clientresevent_t *) isc_event_allocate(mctx, tclone, DNS_EVENT_CLIENTRESDONE, action, arg, sizeof(*event)); - if (event == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup; - } event->result = DNS_R_SERVFAIL; ISC_LIST_INIT(event->answerlist); @@ -1733,10 +1729,6 @@ dns_client_startrequest(dns_client_t *client, dns_message_t *qmessage, isc_event_allocate(client->mctx, tclone, DNS_EVENT_CLIENTREQDONE, action, arg, sizeof(*event)); - if (event == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup; - } ctx = isc_mem_get(client->mctx, sizeof(*ctx)); if (ctx == NULL) @@ -2847,8 +2839,6 @@ dns_client_startupdate(dns_client_t *client, dns_rdataclass_t rdclass, uctx->event = (dns_clientupdateevent_t *) isc_event_allocate(client->mctx, tclone, DNS_EVENT_UPDATEDONE, action, arg, sizeof(*uctx->event)); - if (uctx->event == NULL) - goto fail; if (zonename != NULL) { uctx->zonename = dns_fixedname_name(&uctx->zonefname); result = dns_name_copy(zonename, uctx->zonename, NULL); @@ -2924,11 +2914,8 @@ dns_client_startupdate(dns_client_t *client, dns_rdataclass_t rdclass, event = isc_event_allocate(client->mctx, dns_client_startupdate, DNS_EVENT_STARTUPDATE, startupdate, uctx, sizeof(*event)); - if (event != NULL) { - result = ISC_R_SUCCESS; - isc_task_send(task, &event); - } else - result = ISC_R_NOMEMORY; + result = ISC_R_SUCCESS; + isc_task_send(task, &event); } if (result == ISC_R_SUCCESS) return (result); diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index d4eaa3baa4..c955d216dc 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -2444,10 +2444,6 @@ dns_dispatch_createtcp(dns_dispatchmgr_t *mgr, isc_socket_t *sock, DNS_EVENT_DISPATCHCONTROL, destroy_disp, disp, sizeof(isc_event_t)); - if (disp->ctlevent == NULL) { - result = ISC_R_NOMEMORY; - goto kill_task; - } isc_task_setname(disp->task[0], "tcpdispatch", disp); @@ -2485,11 +2481,6 @@ dns_dispatch_createtcp(dns_dispatchmgr_t *mgr, isc_socket_t *sock, return (ISC_R_SUCCESS); - /* - * Error returns. - */ - kill_task: - isc_task_detach(&disp->task[0]); kill_socket: isc_socket_detach(&disp->socket); deallocate_dispatch: @@ -2897,10 +2888,6 @@ dispatch_createudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr, DNS_EVENT_DISPATCHCONTROL, destroy_disp, disp, sizeof(isc_event_t)); - if (disp->ctlevent == NULL) { - result = ISC_R_NOMEMORY; - goto kill_task; - } disp->sepool = NULL; if (isc_mempool_create(mgr->mctx, sizeof(isc_socketevent_t), @@ -2942,7 +2929,6 @@ dispatch_createudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr, */ kill_ctlevent: isc_event_free(&disp->ctlevent); - kill_task: for (i = 0; i < disp->ntasks; i++) { isc_task_detach(&disp->task[i]); } @@ -3554,8 +3540,6 @@ dns_dispatch_importrecv(dns_dispatch_t *disp, isc_event_t *event) { isc_event_allocate(disp->mgr->mctx, NULL, DNS_EVENT_IMPORTRECVDONE, udp_shrecv, disp, sizeof(isc_socketevent_t)); - if (newsevent == NULL) - return; buf = allocate_udp_buffer(disp); if (buf == NULL) { diff --git a/lib/dns/dnstap.c b/lib/dns/dnstap.c index eb5666535c..a32bac2c56 100644 --- a/lib/dns/dnstap.c +++ b/lib/dns/dnstap.c @@ -807,9 +807,6 @@ check_file_size_and_maybe_reopen(dns_dtenv_t *env) { */ event = isc_event_allocate(env->mctx, NULL, DNS_EVENT_FREESTORAGE, perform_reopen, env, sizeof(*event)); - if (event == NULL) { - goto unlock_and_return; - } isc_task_attach(env->reopen_task, &reopen_task); isc_task_send(reopen_task, &event); env->reopen_queued = true; diff --git a/lib/dns/lookup.c b/lib/dns/lookup.c index 47196c38f5..c555419a3a 100644 --- a/lib/dns/lookup.c +++ b/lib/dns/lookup.c @@ -377,10 +377,6 @@ dns_lookup_create(isc_mem_t *mctx, const dns_name_t *name, dns_rdatatype_t type, ievent = isc_event_allocate(mctx, lookup, DNS_EVENT_LOOKUPDONE, action, arg, sizeof(*lookup->event)); - if (ievent == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup_lookup; - } lookup->event = (dns_lookupevent_t *)ievent; lookup->event->ev_destroy = levent_destroy; lookup->event->ev_destroy_arg = mctx; @@ -426,7 +422,6 @@ dns_lookup_create(isc_mem_t *mctx, const dns_name_t *name, dns_rdatatype_t type, isc_task_detach(&lookup->task); - cleanup_lookup: isc_mem_putanddetach(&mctx, lookup, sizeof(*lookup)); return (result); diff --git a/lib/dns/master.c b/lib/dns/master.c index ae6429ef97..fbb13389e1 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -3078,8 +3078,6 @@ task_send(dns_loadctx_t *lctx) { event = isc_event_allocate(lctx->mctx, NULL, DNS_EVENT_MASTERQUANTUM, load_quantum, lctx, sizeof(*event)); - if (event == NULL) - return (ISC_R_NOMEMORY); isc_task_send(lctx->task, &event); return (ISC_R_SUCCESS); } diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index 7a80bf274a..8e1cb714b9 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -1444,8 +1444,6 @@ task_send(dns_dumpctx_t *dctx) { event = isc_event_allocate(dctx->mctx, NULL, DNS_EVENT_DUMPQUANTUM, dump_quantum, dctx, sizeof(*event)); - if (event == NULL) - return (ISC_R_NOMEMORY); isc_task_send(dctx->task, &event); return (ISC_R_SUCCESS); } diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 3277822091..3033e8f586 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -1052,8 +1052,6 @@ free_rbtdb(dns_rbtdb_t *rbtdb, bool log, isc_event_t *event) { free_rbtdb_callback, rbtdb, sizeof(isc_event_t)); - if (event == NULL) - continue; isc_task_send(rbtdb->task, &event); return; } @@ -1861,16 +1859,11 @@ cleanup_dead_nodes(dns_rbtdb_t *rbtdb, int bucketnum) { DNS_EVENT_RBTPRUNE, prune_tree, node, sizeof(isc_event_t)); - if (ev != NULL) { - new_reference(rbtdb, node); - db = NULL; - attach((dns_db_t *)rbtdb, &db); - ev->ev_sender = db; - isc_task_send(rbtdb->task, &ev); - } else { - ISC_LIST_APPEND(rbtdb->deadnodes[bucketnum], - node, deadlink); - } + new_reference(rbtdb, node); + db = NULL; + attach((dns_db_t *)rbtdb, &db); + ev->ev_sender = db; + isc_task_send(rbtdb->task, &ev); } else { delete_node(rbtdb, node); } @@ -2067,34 +2060,12 @@ decrement_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, DNS_EVENT_RBTPRUNE, prune_tree, node, sizeof(isc_event_t)); - if (ev != NULL) { - new_reference(rbtdb, node); - db = NULL; - attach((dns_db_t *)rbtdb, &db); - ev->ev_sender = db; - isc_task_send(rbtdb->task, &ev); - no_reference = false; - } else { - /* - * XXX: this is a weird situation. We could - * ignore this error case, but then the stale - * node will unlikely be purged except via a - * rare condition such as manual cleanup. So - * we queue it in the deadnodes list, hoping - * the memory shortage is temporary and the node - * will be deleted later. - */ - isc_log_write(dns_lctx, - DNS_LOGCATEGORY_DATABASE, - DNS_LOGMODULE_CACHE, - ISC_LOG_INFO, - "decrement_reference: failed to " - "allocate pruning event"); - INSIST(node->data == NULL); - INSIST(!ISC_LINK_LINKED(node, deadlink)); - ISC_LIST_APPEND(rbtdb->deadnodes[bucket], node, - deadlink); - } + new_reference(rbtdb, node); + db = NULL; + attach((dns_db_t *)rbtdb, &db); + ev->ev_sender = db; + isc_task_send(rbtdb->task, &ev); + no_reference = false; } else { delete_node(rbtdb, node); } diff --git a/lib/dns/request.c b/lib/dns/request.c index c7680c7371..0367c17265 100644 --- a/lib/dns/request.c +++ b/lib/dns/request.c @@ -736,10 +736,6 @@ dns_request_createraw(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf, request->event = (dns_requestevent_t *) isc_event_allocate(mctx, task, DNS_EVENT_REQUESTDONE, action, arg, sizeof(dns_requestevent_t)); - if (request->event == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup; - } isc_task_attach(task, &tclone); request->event->ev_sender = task; request->event->request = request; @@ -926,10 +922,6 @@ dns_request_createvia(dns_requestmgr_t *requestmgr, dns_message_t *message, request->event = (dns_requestevent_t *) isc_event_allocate(mctx, task, DNS_EVENT_REQUESTDONE, action, arg, sizeof(dns_requestevent_t)); - if (request->event == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup; - } isc_task_attach(task, &tclone); request->event->ev_sender = task; request->event->request = request; diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 7dbfdc57a5..dc29bccf3c 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -4620,10 +4620,6 @@ fctx_join(fetchctx_t *fctx, isc_task_t *task, const isc_sockaddr_t *client, event = (dns_fetchevent_t *) isc_event_allocate(fctx->res->mctx, tclone, DNS_EVENT_FETCHDONE, action, arg, sizeof(*event)); - if (event == NULL) { - isc_task_detach(&tclone); - return (ISC_R_NOMEMORY); - } event->result = DNS_R_SERVFAIL; event->qtype = fctx->type; event->db = NULL; diff --git a/lib/dns/validator.c b/lib/dns/validator.c index 5e256436fc..89f27d57ad 100644 --- a/lib/dns/validator.c +++ b/lib/dns/validator.c @@ -3048,10 +3048,6 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, DNS_EVENT_VALIDATORSTART, validator_start, NULL, sizeof(dns_validatorevent_t)); - if (event == NULL) { - result = ISC_R_NOMEMORY; - goto cleanup_val; - } isc_task_attach(task, &tclone); event->validator = val; event->result = ISC_R_FAILURE; @@ -3114,7 +3110,6 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, isc_task_detach(&tclone); isc_event_free(ISC_EVENT_PTR(&event)); - cleanup_val: dns_view_weakdetach(&val->view); isc_mem_put(view->mctx, val, sizeof(*val)); diff --git a/lib/dns/zone.c b/lib/dns/zone.c index f98040b5d4..93a64130bc 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -2189,12 +2189,12 @@ dns_zone_asyncload(dns_zone_t *zone, bool newonly, { isc_event_t *e; dns_asyncload_t *asl = NULL; - isc_result_t result = ISC_R_SUCCESS; REQUIRE(DNS_ZONE_VALID(zone)); - if (zone->zmgr == NULL) + if (zone->zmgr == NULL) { return (ISC_R_FAILURE); + } /* If we already have a load pending, stop now */ LOCK_ZONE(zone); @@ -2214,8 +2214,6 @@ dns_zone_asyncload(dns_zone_t *zone, bool newonly, DNS_EVENT_ZONELOAD, zone_asyncload, asl, sizeof(isc_event_t)); - if (e == NULL) - CHECK(ISC_R_NOMEMORY); zone_iattach(zone, &asl->zone); DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADPENDING); @@ -2223,12 +2221,6 @@ dns_zone_asyncload(dns_zone_t *zone, bool newonly, UNLOCK_ZONE(zone); return (ISC_R_SUCCESS); - - failure: - if (asl != NULL) - isc_mem_put(zone->mctx, asl, sizeof (*asl)); - UNLOCK_ZONE(zone); - return (result); } bool @@ -11363,8 +11355,6 @@ notify_send_queue(dns_notify_t *notify, bool startup) { INSIST(notify->event == NULL); e = isc_event_allocate(notify->mctx, NULL, DNS_EVENT_NOTIFYSENDTOADDR, notify_send_toaddr, notify, sizeof(isc_event_t)); - if (e == NULL) - return (ISC_R_NOMEMORY); if (startup) notify->event = e; e->ev_arg = notify; @@ -12667,10 +12657,6 @@ queue_soa_query(dns_zone_t *zone) { e = isc_event_allocate(zone->mctx, NULL, DNS_EVENT_ZONE, soa_query, zone, sizeof(isc_event_t)); - if (e == NULL) { - cancel_refresh(zone); - return; - } /* * Attach so that we won't clean up @@ -14877,8 +14863,6 @@ zone_send_secureserial(dns_zone_t *zone, uint32_t serial) { DNS_EVENT_ZONESECURESERIAL, receive_secure_serial, zone->secure, sizeof(struct secure_event)); - if (e == NULL) - return (ISC_R_NOMEMORY); ((struct secure_event *)e)->serial = serial; INSIST(LOCKED_ZONE(zone->secure)); zone_iattach(zone->secure, &dummy); @@ -15339,8 +15323,6 @@ zone_send_securedb(dns_zone_t *zone, dns_db_t *db) { DNS_EVENT_ZONESECUREDB, receive_secure_db, zone->secure, sizeof(struct secure_event)); - if (e == NULL) - return (ISC_R_NOMEMORY); dns_db_attach(db, &dummy); ((struct secure_event *)e)->db = dummy; INSIST(LOCKED_ZONE(zone->secure)); @@ -17040,8 +17022,6 @@ zmgr_start_xfrin_ifquota(dns_zonemgr_t *zmgr, dns_zone_t *zone) { */ e = isc_event_allocate(zmgr->mctx, zmgr, DNS_EVENT_ZONESTARTXFRIN, got_transfer_quota, zone, sizeof(isc_event_t)); - if (e == NULL) - return (ISC_R_NOMEMORY); LOCK_ZONE(zone); INSIST(zone->statelist == &zmgr->waiting_for_xfrin); @@ -17097,10 +17077,6 @@ zonemgr_getio(dns_zonemgr_t *zmgr, bool high, io->event = isc_event_allocate(zmgr->mctx, task, DNS_EVENT_IOREADY, action, arg, sizeof(*io->event)); - if (io->event == NULL) { - isc_mem_put(zmgr->mctx, io, sizeof(*io)); - return (ISC_R_NOMEMORY); - } io->zmgr = zmgr; io->high = high; @@ -19253,10 +19229,6 @@ dns_zone_keydone(dns_zone_t *zone, const char *keystr) { e = isc_event_allocate(zone->mctx, zone, DNS_EVENT_KEYDONE, keydone, zone, sizeof(struct keydone)); - if (e == NULL) { - result = ISC_R_NOMEMORY; - goto failure; - } kd = (struct keydone *) e; if (strcasecmp(keystr, "all") == 0) { @@ -19558,10 +19530,6 @@ dns_zone_setnsec3param(dns_zone_t *zone, uint8_t hash, uint8_t flags, e = isc_event_allocate(zone->mctx, zone, DNS_EVENT_SETNSEC3PARAM, setnsec3param, zone, sizeof(struct np3event)); - if (e == NULL) { - result = ISC_R_NOMEMORY; - goto failure; - } npe = (struct np3event *) e; np = &npe->params; @@ -19823,10 +19791,6 @@ dns_zone_setserial(dns_zone_t *zone, uint32_t serial) { e = isc_event_allocate(zone->mctx, zone, DNS_EVENT_SETSERIAL, setserial, zone, sizeof(struct ssevent)); - if (e == NULL) { - result = ISC_R_NOMEMORY; - goto failure; - } sse = (struct ssevent *)e; sse->serial = serial; diff --git a/lib/isc/app.c b/lib/isc/app.c index 48a6eab79f..1a013f1f01 100644 --- a/lib/isc/app.c +++ b/lib/isc/app.c @@ -224,10 +224,6 @@ isc_app_ctxonrun(isc_appctx_t *ctx, isc_mem_t *mctx, isc_task_t *task, isc_task_attach(task, &cloned_task); event = isc_event_allocate(mctx, cloned_task, ISC_APPEVENT_SHUTDOWN, action, arg, sizeof(*event)); - if (event == NULL) { - isc_task_detach(&cloned_task); - return (ISC_R_NOMEMORY); - } LOCK(&ctx->lock); ISC_LINK_INIT(event, ev_link); diff --git a/lib/isc/task.c b/lib/isc/task.c index 6405335951..1c44663f51 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -785,8 +785,6 @@ isc_task_onshutdown(isc_task_t *task0, isc_taskaction_t action, action, arg, sizeof(*event)); - if (event == NULL) - return (ISC_R_NOMEMORY); LOCK(&task->lock); if (TASK_SHUTTINGDOWN(task)) { diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 39e5a5fbe2..be8716ef7c 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -1451,9 +1451,6 @@ allocate_socketevent(isc_mem_t *mctx, void *sender, eventtype, action, arg, sizeof(*ev)); - if (ev == NULL) - return (NULL); - ev->result = ISC_R_UNSET; ISC_LINK_INIT(ev, ev_link); ev->region.base = NULL; @@ -4645,10 +4642,6 @@ isc_socket_accept(isc_socket_t *sock0, dev = (isc_socket_newconnev_t *) isc_event_allocate(manager->mctx, task, ISC_SOCKEVENT_NEWCONN, action, arg, sizeof(*dev)); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } ISC_LINK_INIT(dev, ev_link); result = allocate_socket(manager, sock->type, &nsock); @@ -4720,10 +4713,6 @@ isc_socket_connect(isc_socket_t *sock0, const isc_sockaddr_t *addr, ISC_SOCKEVENT_CONNECT, action, arg, sizeof(*dev)); - if (dev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } ISC_LINK_INIT(dev, ev_link); if (sock->connecting) { diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c index 4f78c2d40c..b754fce824 100644 --- a/lib/isc/win32/socket.c +++ b/lib/isc/win32/socket.c @@ -983,8 +983,6 @@ allocate_socketevent(isc_mem_t *mctx, isc_socket_t *sock, ev = (isc_socketevent_t *)isc_event_allocate(mctx, sock, eventtype, action, arg, sizeof(*ev)); - if (ev == NULL) - return (NULL); ev->result = ISC_R_IOERROR; // XXXMLG temporary change to detect failure to set ISC_LINK_INIT(ev, ev_link); @@ -3062,10 +3060,6 @@ isc_socket_accept(isc_socket_t *sock, adev = (isc_socket_newconnev_t *) isc_event_allocate(manager->mctx, task, ISC_SOCKEVENT_NEWCONN, action, arg, sizeof(*adev)); - if (adev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } ISC_LINK_INIT(adev, ev_link); result = allocate_socket(manager, sock->type, &nsock); @@ -3210,10 +3204,6 @@ isc_socket_connect(isc_socket_t *sock, const isc_sockaddr_t *addr, ISC_SOCKEVENT_CONNECT, action, arg, sizeof(*cdev)); - if (cdev == NULL) { - UNLOCK(&sock->lock); - return (ISC_R_NOMEMORY); - } ISC_LINK_INIT(cdev, ev_link); if (sock->connected) { diff --git a/lib/ns/update.c b/lib/ns/update.c index 1141054750..738a9d828a 100644 --- a/lib/ns/update.c +++ b/lib/ns/update.c @@ -1534,8 +1534,6 @@ send_update_event(ns_client_t *client, dns_zone_t *zone) { event = (update_event_t *) isc_event_allocate(client->mctx, client, DNS_EVENT_UPDATE, update_action, NULL, sizeof(*event)); - if (event == NULL) - FAIL(ISC_R_NOMEMORY); event->zone = zone; event->result = ISC_R_SUCCESS; @@ -1548,9 +1546,6 @@ send_update_event(ns_client_t *client, dns_zone_t *zone) { dns_zone_gettask(zone, &zonetask); isc_task_send(zonetask, ISC_EVENT_PTR(&event)); - failure: - if (event != NULL) - isc_event_free(ISC_EVENT_PTR(&event)); return (result); } @@ -3489,8 +3484,6 @@ send_forward_event(ns_client_t *client, dns_zone_t *zone) { event = (update_event_t *) isc_event_allocate(client->mctx, client, DNS_EVENT_UPDATE, forward_action, NULL, sizeof(*event)); - if (event == NULL) - FAIL(ISC_R_NOMEMORY); event->zone = zone; event->result = ISC_R_SUCCESS;