if ((tmp = edtk_driver_alloc_wrapper(strlen(c->o.ret_grptr->gr_mem))) == NULL) { return reply_error(desc, ENOMEM);
{ int members = 0;  make_groups_list(desc, c, msg, &members, &msgcount); msgcount = LOAD_LIST(msg, msgcount, members);
reply_xtra_group(descriptor_t *desc, callstate_t *c){    ErlDrvTermData      msg[64];    int                 msgcount = 0;    int                 res;    int                 members = 0;    char                *tmp = NULL;    ErlDrvBinary        *tofree[64];    int                 num_tofree = 0;    int                 i;    ErlDrvBinary        *tmpbin = NULL;    tmp = tmp; tmpbin = tmpbin;    msgcount = LOAD_PORT(msg, msgcount, driver_mk_port(desc->port));    members = 2;        /* Rather, members will be 2 very shortly */    if (c->o.__expect) {        msgcount = LOAD_ATOM(msg, msgcount, am_ok);        {            int members = 0;             {                 int members = 0;                 msgcount = LOAD_ATOM(msg, msgcount, am_group);                 members++;                 if ((tmp = edtk_driver_alloc_wrapper(strlen(c->o.ret_grptr->gr_name))) == NULL) {                  return reply_error(desc, ENOMEM);                 }                 memcpy(tmp,  c->o.ret_grptr->gr_name, strlen(c->o.ret_grptr->gr_name));                 tmpbin = edtk_alloced_ptr2ErlDrvBinary(tmp);                 msgcount = LOAD_BINARY(msg, msgcount, tmpbin, 0, strlen(c->o.ret_grptr->gr_name));                 /* driver_output_term() incrs refc, and we're done, so decr refc LATER */                 /*QQQDELETEME XXX BUG?? CORE DUMPS UNDER LINUX: tofree[num_tofree++] = edtk_alloced_ptr2ErlDrvBinary(tmpbin); */                 tofree[num_tofree++] = tmpbin;                 members++;                 if ((tmp = edtk_driver_alloc_wrapper(strlen(c->o.ret_grptr->gr_passwd))) == NULL) {                  return reply_error(desc, ENOMEM);                 }                 memcpy(tmp,  c->o.ret_grptr->gr_passwd, strlen(c->o.ret_grptr->gr_passwd));                 tmpbin = edtk_alloced_ptr2ErlDrvBinary(tmp);                 msgcount = LOAD_BINARY(msg, msgcount, tmpbin, 0, strlen(c->o.ret_grptr->gr_passwd));                 /* driver_output_term() incrs refc, and we're done, so decr refc LATER */                 /*QQQDELETEME XXX BUG?? CORE DUMPS UNDER LINUX: tofree[num_tofree++] = edtk_alloced_ptr2ErlDrvBinary(tmpbin); */                 tofree[num_tofree++] = tmpbin;                 members++;                 msgcount = LOAD_INT(msg, msgcount, c->o.ret_grptr->gr_gid);                 members++;                 if ((tmp = edtk_driver_alloc_wrapper(strlen(c->o.ret_grptr->gr_mem))) == NULL) {                  return reply_error(desc, ENOMEM);                 }                 memcpy(tmp,  c->o.ret_grptr->gr_mem, strlen(c->o.ret_grptr->gr_mem));                 tmpbin = edtk_alloced_ptr2ErlDrvBinary(tmp);                 msgcount = LOAD_BINARY(msg, msgcount, tmpbin, 0, strlen(c->o.ret_grptr->gr_mem));                 /* driver_output_term() incrs refc, and we're done, so decr refc LATER */                 /*QQQDELETEME XXX BUG?? CORE DUMPS UNDER LINUX: tofree[num_tofree++] = edtk_alloced_ptr2ErlDrvBinary(tmpbin); */                 tofree[num_tofree++] = tmpbin;                 members++;                 msgcount = LOAD_TUPLE(msg, msgcount, members); /* XXX */             }             members++;            msgcount = LOAD_TUPLE(msg, msgcount, members);        }    } else {        msgcount = LOAD_ATOM(msg, msgcount, am_error);        {            int members = 0;             msgcount = LOAD_INT(msg, msgcount, c->o.__expect_errval);             members++;            msgcount = LOAD_TUPLE(msg, msgcount, members);        }    }    msgcount = LOAD_TUPLE(msg, msgcount, 3);    edtk_debug("reply_xtra_group: i = %d", msgcount);    res = driver_output_term(desc->port, msg, msgcount);    edtk_debug("reply_xtra_group: res = %d", res);    if (res < 0) {        fprintf(stderr, "\r\n\r\nreply_xtra_group: driver_output_term() failed!         This should never happen!\r\n\r\n");    }    for (i = 0; i < num_tofree; i++) {        driver_free_binary(tofree[i]);    }    return res;}