[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sc/source

Eike Rathke erack at redhat.com
Tue Jun 16 07:39:48 PDT 2015


 sc/source/core/tool/token.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 012a2f0876663af77316c657c0dbdafd82acb79e
Author: Eike Rathke <erack at redhat.com>
Date:   Sat Jun 13 15:12:32 2015 +0200

    do not access token data after token has been destroyed
    
    Change-Id: I624e64745fd3874be3e1bd3df6bac18dfb17aebb
    (cherry picked from commit c1fc84ac140d519e0bfa7a607e36771682b08eed)
    Reviewed-on: https://gerrit.libreoffice.org/16258
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index a96936c..1e5c7d2 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2245,9 +2245,9 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons
                     OUString aTabName;
                     sal_uInt16 nFileId;
                     GetExternalTableData(pOldDoc, pNewDoc, rRef1.Tab(), aTabName, nFileId);
-                    pCode[j]->DecRef();
                     ScExternalDoubleRefToken* pToken = new ScExternalDoubleRefToken(nFileId, aTabName, rRef);
                     pToken->IncRef();
+                    pCode[j]->DecRef(); // ATTENTION: rRef can't be used after this point
                     pCode[j] = pToken;
                 }
             }


More information about the Libreoffice-commits mailing list