From: Todd C. Miller Date: Tue, 3 Dec 2013 21:10:11 +0000 (-0700) Subject: Fix several issues found by the clang static analyzer; Daniel Kopecek X-Git-Tag: SUDO_1_8_9^2~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=543d3b701ec5050a84be0b29f59fb23f002cef7e;p=sudo Fix several issues found by the clang static analyzer; Daniel Kopecek --- diff --git a/plugins/sudoers/sssd.c b/plugins/sudoers/sssd.c index b7ed9dc8b..5ce62b00c 100644 --- a/plugins/sudoers/sssd.c +++ b/plugins/sudoers/sssd.c @@ -311,9 +311,8 @@ static int sudo_sss_close(struct sudo_nss *nss) if (nss && nss->handle) { handle = nss->handle; sudo_dso_unload(handle->ssslib); + efree(nss->handle); } - - efree(nss->handle); debug_return_int(0); } @@ -663,12 +662,15 @@ sudo_sss_result_get(struct sudo_nss *nss, struct passwd *pw, uint32_t *state) *state |= _SUDO_SSS_STATE_HOSTMATCH; } } + sudo_debug_printf(SUDO_DEBUG_DEBUG, + "u_sss_result=(%p, %u) => f_sss_result=(%p, %u)", u_sss_result, + u_sss_result->num_rules, f_sss_result, f_sss_result->num_rules); + } else { + sudo_debug_printf(SUDO_DEBUG_DEBUG, + "u_sss_result=(%p, %u) => f_sss_result=NULL", u_sss_result, + u_sss_result->num_rules); } - sudo_debug_printf(SUDO_DEBUG_DEBUG, - "u_sss_result=(%p, %u) => f_sss_result=(%p, %u)", u_sss_result, - u_sss_result->num_rules, f_sss_result, f_sss_result->num_rules); - handle->fn_free_result(u_sss_result); debug_return_ptr(f_sss_result);