Fix use-after-free
[openssl.git] / crypto / rand / randfile.c
index 904653f3bbacbc24a06204668dd242fb3b814d1b..f5026429977bb5ef25a573d01b842eff13444385 100644 (file)
@@ -176,7 +176,7 @@ int RAND_write_file(const char *file)
     if (out == NULL)
         out = openssl_fopen(file, "wb");
     if (out == NULL) {
-        RANDerr(RAND_F_RAND_LOAD_FILE, RAND_R_CANNOT_OPEN_FILE);
+        RANDerr(RAND_F_RAND_WRITE_FILE, RAND_R_CANNOT_OPEN_FILE);
         ERR_add_error_data(2, "Filename=", file);
         return -1;
     }