]> git.mxchange.org Git - simgear.git/commitdiff
Fix user-after-free in HTTP repo code
authorJames Turner <zakalawe@mac.com>
Thu, 2 Jun 2016 22:53:15 +0000 (23:53 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
simgear/io/HTTPRepository.cxx

index 05635dac4c62ac15c5710d49aebd53c408fa4f4c..21b01a7268eeba035c689b9c21c92bbc007c72c4 100644 (file)
@@ -1143,11 +1143,12 @@ HTTPRepository::failure() const
             directories.erase(it);
             Dir dir(d->absolutePath());
             bool result = dir.remove(true);
-            delete d;
 
             // update the hash cache too
             updatedFileContents(d->absolutePath(), std::string());
 
+            delete d;
+
             return result;
         }