From 678a79946d1321c0a63f2499236829237b0f157f Mon Sep 17 00:00:00 2001 From: Steffen Nurpmeso Date: Thu, 9 Oct 2014 14:29:39 +0200 Subject: [PATCH] Fix double delete for file_case usage.. This fixes (Encapsulate searchpath:: FILE*'s in new class file_case), the very first commit of this series. At that time i falsely thought that the ownership is not overtaken but that recursion occurs, so that the caller is still responsible for the file_case* pointer, which is plain wrong, since a file_iterator object is still created and that always overtakes ownership. --- src/roff/troff/input.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index 238cc670..adef5a3b 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -799,10 +799,9 @@ void next_file() else { file_case *fcp = include_search_path.open_file_cautious(nm.contents(), fcp->fc_const_path); - if (fcp != NULL) { + if (fcp != NULL) input_stack::next_file(fcp, nm.contents()); - delete fcp; - } else + else error("can't open `%1': %2", nm.contents(), strerror(errno)); } tok.next(); -- 2.11.4.GIT