From: Todd C. Miller Date: Wed, 18 Apr 2018 16:09:22 +0000 (-0600) Subject: Fix a memory leak on the error path. X-Git-Tag: SUDO_1_8_23^2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8eccfbd7bd1282153f0e053a68ddee42154578b0;p=sudo Fix a memory leak on the error path. --- diff --git a/src/load_plugins.c b/src/load_plugins.c index 620e72f45..5c2706b3e 100644 --- a/src/load_plugins.c +++ b/src/load_plugins.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2016 Todd C. Miller + * Copyright (c) 2009-2018 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -312,6 +312,7 @@ sudo_load_plugins(struct plugin_container *policy_plugin, info->path = strdup(SUDOERS_PLUGIN); if (info->symbol_name == NULL || info->path == NULL) { sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory")); + free_plugin_info(info); goto done; } /* info->options = NULL; */ @@ -331,6 +332,7 @@ sudo_load_plugins(struct plugin_container *policy_plugin, info->path = strdup(SUDOERS_PLUGIN); if (info->symbol_name == NULL || info->path == NULL) { sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory")); + free_plugin_info(info); goto done; } /* info->options = NULL; */