connectivity/source/drivers/dbase/DTable.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
New commits: commit 7931ef2abbcef22de5cdddd26738e4dd8d1d8ca5 Author: Takeshi Abe <t...@fixedpoint.jp> Date: Wed Jun 28 12:08:22 2017 +0900 connectivity: Fix memory leak at finding non-empty file Change-Id: I7134dc4efb9a659727474a788dce19fcb8ea2da7 Reviewed-on: https://gerrit.libreoffice.org/39338 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 97bed39062b8..6da1f893e6fc 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -55,6 +55,7 @@ #include <algorithm> #include <cassert> +#include <memory> using namespace ::comphelper; using namespace connectivity; @@ -1057,13 +1058,10 @@ bool ODbaseTable::CreateImpl() if (aContent.isDocument()) { // Only if the file exists with length > 0 raise an error - SvStream* pFileStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::READ); + std::unique_ptr<SvStream> pFileStream(createStream_simpleError( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::READ)); if (pFileStream && pFileStream->Seek(STREAM_SEEK_TO_END)) - { return false; - } - delete pFileStream; } } catch(const Exception&) // an exception is thrown when no file exists _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits