I seem to have fixed it by using
Tensor q_t;
const TensorShape &sh = TensorShape({sdr->sht->nlm});
OP_REQUIRES_OK(context, context->allocate_temp(DT_COMPLEX128, sh, &q_t));

but it’s not clear to me why that works.  When running the op, I get an abort, double-free or corruption.
From reading use of allocate_temp in the TF codebase, this seems like it should work.