--- pbx.c 2011-05-18 08:14:08.000000000 -0300 +++ pbx.c.bak 2011-05-18 08:17:54.000000000 -0300 @@ -3533,9 +3533,9 @@ if (acfptr->mod) { u = __ast_module_user_add(acfptr->mod, chan); } + ast_str_reset(*str); if (acfptr->read2) { /* ast_str enabled */ - ast_str_reset(*str); res = acfptr->read2(chan, copy, args, str, maxlen); } else { /* Legacy function pointer, allocate buffer for result */