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 392efddb21752081ec48025e05b08e3fdac84ed6..cc73c799fd04b886babebaa531d663658d0e30d0 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