]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix audit test module initialization
authorGreg Hudson <ghudson@mit.edu>
Sun, 6 Oct 2013 00:13:39 +0000 (20:13 -0400)
committerGreg Hudson <ghudson@mit.edu>
Sun, 6 Oct 2013 00:13:39 +0000 (20:13 -0400)
Check if the fopen result is NULL, not whether it's less than zero.

ticket: 7713 (new)
target_version: 1.12
tags: pullups

src/plugins/audit/test/au_test.c

index 54bf564b155e401194ebda3292e6b29785925018..76e711e534b77e21e1238f8e14e71de0f8c71b84 100644 (file)
@@ -55,9 +55,8 @@ static krb5_error_code
 open_au(krb5_audit_moddata *auctx)
 {
     au_fd = fopen("au.log", "a+");
-    if ( au_fd < 0) {
+    if (au_fd == NULL)
         return KRB5_PLUGIN_NO_HANDLE; /* audit module is unavailable */
-    }
     k5_mutex_init(&lock);
     return 0;
 }