Make sure an error condition is returned if, for some reason, the file
authorRichard Levitte <levitte@openssl.org>
Sun, 19 Mar 2000 19:10:03 +0000 (19:10 +0000)
committerRichard Levitte <levitte@openssl.org>
Sun, 19 Mar 2000 19:10:03 +0000 (19:10 +0000)
couldn't be opened.

crypto/rand/randfile.c

index 392efdd..cc73c79 100644 (file)
@@ -163,7 +163,11 @@ int RAND_write_file(const char *file)
                out = fopen(file,"wb");
 #endif
                }
-       if (out == NULL) goto err;
+       if (out == NULL)
+               {
+               err=1;
+               goto err;
+               }
 #ifndef NO_CHMOD
        chmod(file,0600);
 #endif