Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
d97b5e42
Kaydet (Commit)
d97b5e42
authored
Tem 16, 2014
tarafından
Takeshi Abe
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid possible memory leaks in case of exceptions
Change-Id: Icecc2cce52d7f27c030270639e6b85877e3aa620
üst
9a6cf486
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
image.cxx
basic/source/classes/image.cxx
+9
-8
sb.cxx
basic/source/classes/sb.cxx
+3
-2
dim.cxx
basic/source/comp/dim.cxx
+3
-5
No files found.
basic/source/classes/image.cxx
Dosyayı görüntüle @
d97b5e42
...
...
@@ -25,6 +25,8 @@
#include <string.h>
#include "image.hxx"
#include <codegen.hxx>
#include <boost/scoped_array.hpp>
SbiImage
::
SbiImage
()
{
pStringOff
=
NULL
;
...
...
@@ -206,15 +208,14 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
pStrings
=
new
sal_Unicode
[
nLen
];
nStringSize
=
(
sal_uInt16
)
nLen
;
char
*
pByteStrings
=
new
char
[
nLen
]
;
r
.
Read
(
pByteStrings
,
nStringSize
);
boost
::
scoped_array
<
char
>
pByteStrings
(
new
char
[
nLen
])
;
r
.
Read
(
pByteStrings
.
get
()
,
nStringSize
);
for
(
short
j
=
0
;
j
<
nStrings
;
j
++
)
{
sal_uInt16
nOff2
=
(
sal_uInt16
)
pStringOff
[
j
];
OUString
aStr
(
pByteStrings
+
nOff2
,
strlen
(
pByteStrings
+
nOff2
),
eCharSet
);
OUString
aStr
(
pByteStrings
.
get
()
+
nOff2
,
strlen
(
pByteStrings
.
get
()
+
nOff2
),
eCharSet
);
memcpy
(
pStrings
+
nOff2
,
aStr
.
getStr
(),
(
aStr
.
getLength
()
+
1
)
*
sizeof
(
sal_Unicode
)
);
}
delete
[]
pByteStrings
;
}
break
;
case
B_MODEND
:
...
...
@@ -324,17 +325,17 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
r
.
WriteUInt32
(
(
sal_uInt32
)
pStringOff
[
i
]
);
}
// Then the String-Block
char
*
pByteStrings
=
new
char
[
nStringSize
]
;
boost
::
scoped_array
<
char
>
pByteStrings
(
new
char
[
nStringSize
])
;
for
(
i
=
0
;
i
<
nStrings
;
i
++
)
{
sal_uInt16
nOff
=
(
sal_uInt16
)
pStringOff
[
i
];
OString
aStr
(
OUStringToOString
(
OUString
(
pStrings
+
nOff
),
eCharSet
));
memcpy
(
pByteStrings
+
nOff
,
aStr
.
getStr
(),
(
aStr
.
getLength
()
+
1
)
*
sizeof
(
char
)
);
memcpy
(
pByteStrings
.
get
()
+
nOff
,
aStr
.
getStr
(),
(
aStr
.
getLength
()
+
1
)
*
sizeof
(
char
)
);
}
r
.
WriteUInt32
(
(
sal_uInt32
)
nStringSize
);
r
.
Write
(
pByteStrings
,
nStringSize
);
r
.
Write
(
pByteStrings
.
get
()
,
nStringSize
);
delete
[]
pByteStrings
;
pByteStrings
.
reset
()
;
SbiCloseRecord
(
r
,
nPos
);
}
// Set overall length
...
...
basic/source/classes/sb.cxx
Dosyayı görüntüle @
d97b5e42
...
...
@@ -46,6 +46,7 @@
#include <com/sun/star/util/XCloseBroadcaster.hpp>
#include <com/sun/star/util/XCloseListener.hpp>
#include "errobject.hxx"
#include <boost/scoped_array.hpp>
#include <boost/unordered_map.hpp>
#include <com/sun/star/script/ModuleType.hpp>
...
...
@@ -1872,7 +1873,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
// #95459 Delete dialogs, otherwise endless recursion
// in SbxVarable::GetType() if dialogs are accessed
sal_uInt16
nObjCount
=
pObjs
->
Count
();
SbxVariable
**
ppDeleteTab
=
new
SbxVariable
*
[
nObjCount
]
;
boost
::
scoped_array
<
SbxVariable
*>
ppDeleteTab
(
new
SbxVariable
*
[
nObjCount
])
;
sal_uInt16
nObj
;
for
(
nObj
=
0
;
nObj
<
nObjCount
;
nObj
++
)
...
...
@@ -1889,7 +1890,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
pObjs
->
Remove
(
pVar
);
}
}
delete
[]
ppDeleteTab
;
ppDeleteTab
.
reset
()
;
sal_uInt16
nMod
;
pModules
->
Clear
();
...
...
basic/source/comp/dim.cxx
Dosyayı görüntüle @
d97b5e42
...
...
@@ -588,7 +588,7 @@ void SbiParser::DefType( bool bPrivate )
SbxObject
*
pType
=
new
SbxObject
(
aSym
);
SbiSymDef
*
pElem
;
boost
::
scoped_ptr
<
SbiSymDef
>
pElem
;
SbiDimList
*
pDim
=
NULL
;
bool
bDone
=
false
;
...
...
@@ -597,19 +597,17 @@ void SbiParser::DefType( bool bPrivate )
switch
(
Peek
()
)
{
case
ENDTYPE
:
pElem
=
NULL
;
bDone
=
true
;
Next
();
break
;
case
EOLN
:
case
REM
:
pElem
=
NULL
;
Next
();
break
;
default
:
pElem
=
VarDecl
(
&
pDim
,
false
,
false
);
pElem
.
reset
(
VarDecl
(
&
pDim
,
false
,
false
)
);
if
(
!
pElem
)
bDone
=
true
;
// Error occurred
}
...
...
@@ -678,7 +676,7 @@ void SbiParser::DefType( bool bPrivate )
pTypeMembers
->
Insert
(
pTypeElem
,
pTypeMembers
->
Count
()
);
}
delete
pDim
,
pDim
=
NULL
;
delete
pElem
;
pElem
.
reset
()
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment