Add support for garbage collecting info passed to the plugin before

exit to appease address sanitizer's leak detector (and valgrind's
leak checker).  We can't free these sooner since the plugin may be
using the memory.  For plugin API 2.0 it should be make clear that
the plugin must make a copy of the data in the arrays passed in to
the plugin's open() function.  Only enabled if NO_LEAKS is defined.
This commit is contained in:
Todd C. Miller
2016-01-27 15:37:15 -07:00
parent ab11cdde2c
commit 9b3ef072f9
3 changed files with 112 additions and 9 deletions

View File

@@ -87,7 +87,7 @@ struct plugin_container {
TAILQ_ENTRY(plugin_container) entries;
struct sudo_conf_debug_file_list *debug_files;
const char *name;
const char *path;
char *path;
char * const *options;
void *handle;
int debug_instance;