From fa555555676f1ceeb3944b247ba835aa0142eed4 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 2 Jun 2016 23:53:15 +0100 Subject: [PATCH] Fix user-after-free in HTTP repo code --- simgear/io/HTTPRepository.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simgear/io/HTTPRepository.cxx b/simgear/io/HTTPRepository.cxx index 05635dac..21b01a72 100644 --- a/simgear/io/HTTPRepository.cxx +++ b/simgear/io/HTTPRepository.cxx @@ -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; } -- 2.39.5