summaryrefslogtreecommitdiff
path: root/cmd/modutil
diff options
context:
space:
mode:
authorFranziskus Kiefer <franziskuskiefer@gmail.com>2015-10-14 13:43:49 -0700
committerFranziskus Kiefer <franziskuskiefer@gmail.com>2015-10-14 13:43:49 -0700
commit725dee213f5321fb2e1123137031a594c6b1a535 (patch)
tree80b75a93b905651b62d47eb322c11c60d8b58639 /cmd/modutil
parent5026cb0cd05ec0b1478e977e85276fa9926c2ad5 (diff)
downloadnss-hg-725dee213f5321fb2e1123137031a594c6b1a535.tar.gz
Bug 1214777 - [CID 983287] leaked_storage: Variable dir going out of scope leaks the storage it points to, r=mt
Diffstat (limited to 'cmd/modutil')
-rw-r--r--cmd/modutil/install.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/modutil/install.c b/cmd/modutil/install.c
index 283fc790e..bcc7c7e24 100644
--- a/cmd/modutil/install.c
+++ b/cmd/modutil/install.c
@@ -833,7 +833,10 @@ rm_dash_r (char *path)
/* Recursively delete all entries in the directory */
while((entry = PR_ReadDir(dir, PR_SKIP_BOTH)) != NULL) {
sprintf(filename, "%s/%s", path, entry->name);
- if(rm_dash_r(filename)) return -1;
+ if(rm_dash_r(filename)) {
+ PR_CloseDir(dir);
+ return -1;
+ }
}
if(PR_CloseDir(dir) != PR_SUCCESS) {