Use non-exiting allocatings in the sudoers plugin.

This commit is contained in:
Todd C. Miller
2015-06-17 06:49:59 -06:00
parent 6da04821d7
commit d004b02fc6
36 changed files with 1073 additions and 810 deletions

View File

@@ -135,7 +135,11 @@ group_plugin_load(char *plugin_info)
}
}
if (ac != 0) {
argv = sudo_emallocarray(ac, sizeof(char *));
argv = reallocarray(NULL, ac, sizeof(char *));
if (argv == NULL) {
sudo_warnx(U_("unable to allocate memory"));
goto done;
}
ac = 0;
for ((cp = strtok(args, " \t")); cp; (cp = strtok(NULL, " \t")))
argv[ac++] = cp;
@@ -145,7 +149,7 @@ group_plugin_load(char *plugin_info)
rc = (group_plugin->init)(GROUP_API_VERSION, sudo_printf, argv);
done:
sudo_efree(argv);
free(argv);
if (rc != true) {
if (group_handle != NULL) {