diff --git a/src/paragraph_funcs.cpp b/src/paragraph_funcs.cpp index f771391560..d8a7a858fb 100644 --- a/src/paragraph_funcs.cpp +++ b/src/paragraph_funcs.cpp @@ -42,7 +42,11 @@ static bool moveItem(Paragraph & fromPar, pos_type fromPos, if (Inset * tmpInset = fromPar.getInset(fromPos)) { fromPar.releaseInset(fromPos); // The inset is not in fromPar any more. - return toPar.insertInset(toPos, tmpInset, tmpFont, tmpChange); + if (!toPar.insertInset(toPos, tmpInset, tmpFont, tmpChange)) { + delete tmpInset; + return false; + } + return true; } char_type const tmpChar = fromPar.getChar(fromPos);