+14 October 2011: Wouter
+ - Fix for out-of-memory condition in libunbound (thanks
+ Robert Fleischman).
+
13 October 2011: Wouter
- Fix --enable-allsymbols, it depended on link specifics of the
target platform, or fptr_wlist assertion failures could occur.
/* setup */
uint32_t m;
struct libworker* w = (struct libworker*)arg;
- struct ub_ctx* ctx = w->ctx;
+ struct ub_ctx* ctx;
+ if(!w) {
+ log_err("libunbound bg worker init failed, nomem");
+ return NULL;
+ }
+ ctx = w->ctx;
log_thread_set(&w->thread_num);
#ifdef THREADS_DISABLED
/* we are forked */
tube_close_write(ctx->qq_pipe);
tube_close_read(ctx->rr_pipe);
#endif
- if(!w) {
- log_err("libunbound bg worker init failed, nomem");
- return NULL;
- }
if(!tube_setup_bg_listen(ctx->qq_pipe, w->base,
libworker_handle_control_cmd, w)) {
log_err("libunbound bg worker init failed, no bglisten");
if(ctx->dothread) {
lock_basic_unlock(&ctx->cfglock);
w = libworker_setup(ctx, 1);
+ if(!w) return UB_NOMEM;
w->is_bg_thread = 1;
#ifdef ENABLE_LOCK_CHECKS
w->thread_num = 1; /* for nicer DEBUG checklocks */
#endif
- if(!w) return UB_NOMEM;
ub_thread_create(&ctx->bg_tid, libworker_dobg, w);
} else {
lock_basic_unlock(&ctx->cfglock);