]> granicus.if.org Git - apache/commitdiff
* modules/cache/mod_cache_disk.c (write_headers): Handle
authorJoe Orton <jorton@apache.org>
Fri, 5 Oct 2018 14:38:28 +0000 (14:38 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 5 Oct 2018 14:38:28 +0000 (14:38 +0000)
  mkdir_structure error case.  Fixes Coverity warning.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1842926 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/mod_cache_disk.c

index 52d5dba0b12e05a9c311b0cfd736aa46248abaa1..ddf16f9c0371dbffadbf39cd49c10e71d22b7254 100644 (file)
@@ -994,10 +994,11 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)
             }
 
             rv = mkdir_structure(conf, dobj->hdrs.file, r->pool);
-
-            rv = apr_file_mktemp(&dobj->vary.tempfd, dobj->vary.tempfile,
-                                 APR_CREATE | APR_WRITE | APR_BINARY | APR_EXCL,
-                                 dobj->vary.pool);
+            if (rv == APR_SUCCESS) {
+                rv = apr_file_mktemp(&dobj->vary.tempfd, dobj->vary.tempfile,
+                                     APR_CREATE | APR_WRITE | APR_BINARY | APR_EXCL,
+                                     dobj->vary.pool);
+            }
 
             if (rv != APR_SUCCESS) {
                 ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, APLOGNO(00721)