From 89f997a28992f4cf34e8ce44f96c4bde51909fc1 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 19 Jul 2020 11:17:44 +0200 Subject: [PATCH] Coverity: Use after free (_removeObject may delete the DocumentObject) --- src/App/Document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 06d160f9a1..7ea4fccec6 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -4394,7 +4394,7 @@ DocumentObject* Document::moveObject(DocumentObject* obj, bool recursive) // True object move without copy is only safe when undo is off on both // documents. - if(!recursive && !d->iUndoMode && !that->d->iUndoMode) { + if(!recursive && !d->iUndoMode && !that->d->iUndoMode && !that->d->rollback) { // all object of the other document that refer to this object must be nullified that->breakDependency(obj, false); std::string objname = getUniqueObjectName(obj->getNameInDocument());