Brandon
On Tue, Dec 20, 2011 at 10:28 PM, caox <caox@...> wrote:
HiSorry to bother. According to the description and code example, the API nerr_log_error should free the err chain. But I didn't find the respective code to release the err chain inside the implementation:void nerr_log_error (NEOERR *err){NEOERR *more;char buf[1024];char *err_name;if (err == STATUS_OK)return;if (err == INTERNAL_ERR){ne_warn ("Internal error");return;}more = err;fprintf (stderr, "Traceback (innermost last):\n");while (more && more != INTERNAL_ERR){err = more;more = err->next;if (err->error != NERR_PASS){NEOERR *r;if (err->error == 0){err_name = buf;snprintf (buf, sizeof (buf), "Unknown Error");}else{r = uListGet (Errors, err->error - 1, (void *)&err_name);if (r != STATUS_OK){err_name = buf;snpri ntf (buf, sizeof (buf), "Error %d", err->error);}}fprintf (stder r, " File \"%s\", line %d, in %s()\n%s: %s\n", err->file,err->lineno, err->func, err_name, err->desc);}else{fprintf (stderr, " File \"%s\", line %d, in %s()\n", err->file,err->lineno, err->func);if (err->desc[0]){fprintf (stderr, " %s\n", err->desc);}}}}So, is the err chain freed in other place or I have missed something inside the function? Does nerr_log_error free the err chain, as for nerr_err_string and nerr_err_traceback?Thanks.
B.R.