]> granicus.if.org Git - sudo/commitdiff
Fix several issues found by the clang static analyzer; Daniel Kopecek
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 3 Dec 2013 21:10:11 +0000 (14:10 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 3 Dec 2013 21:10:11 +0000 (14:10 -0700)
plugins/sudoers/sssd.c

index b7ed9dc8b38e26a51efc4c1b8ed5e8c3fe8186ad..5ce62b00c71f3be20a50ccd534c5cc8793f4776d 100644 (file)
@@ -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);