Simple garbage collection (really a to-be-freed list) for the sudoers

plugin.  Almost identical to what sudo.c uses.  Currenly only the
environment strings are collected at exit time which is enough to
quiet address sanitizer's leak detector.
This commit is contained in:
Todd C. Miller
2016-01-28 14:53:48 -07:00
parent 7b2fbed45d
commit 21d6fc3d8f
5 changed files with 174 additions and 2 deletions

View File

@@ -377,4 +377,14 @@ extern const char *path_plugin_dir;
char *resolve_editor(const char *ed, size_t edlen, int nfiles, char **files,
int *argc_out, char ***argv_out, char * const *whitelist);
/* gc.c */
enum sudoers_gc_types {
GC_UNKNOWN,
GC_VECTOR,
GC_PTR
};
bool sudoers_gc_add(enum sudoers_gc_types type, void *ptr);
bool sudoers_gc_remove(enum sudoers_gc_types type, void *ptr);
void sudoers_gc_init(void);
#endif /* SUDOERS_SUDOERS_H */