From 082b8bff2fff57f856845ce76d0e1e4f5e5a3434 Mon Sep 17 00:00:00 2001
From: Murai Takashi <tmurai01@gmail.com>
Date: Mon, 13 Mar 2017 15:31:48 +0900
Subject: [PATCH 33/33] vfs.cpp: fix use after free.
---
src/system/boot/loader/vfs.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/system/boot/loader/vfs.cpp b/src/system/boot/loader/vfs.cpp
index 2a57686..e9673ea 100644
a
|
b
|
int
|
1203 | 1203 | closedir(DIR* dir) |
1204 | 1204 | { |
1205 | 1205 | if (dir != NULL) { |
1206 | | dir->directory->Close(dir->cookie); |
1207 | | dir->directory->Release(); |
| 1206 | if (dir->directory->Close(dir->cookie) == B_OK) { |
| 1207 | dir->directory->Release(); |
| 1208 | } |
1208 | 1209 | delete dir; |
1209 | 1210 | } |
1210 | 1211 | |