Skip to content

Commit ab0f0c4

Browse files
Merge pull request livecode#2443 from livecodesebastien/coverity_scan
Coverity scan fixes
2 parents 4d9fff4 + 7706d76 commit ab0f0c4

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

engine/src/deploy.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,13 +1017,10 @@ void MCIdeDmgBuild::exec_ctxt(MCExecContext& ctxt)
10171017

10181018
/////////
10191019

1020+
// SN-2015-06-19: [[ CID 100294 ]] Check the return value.
10201021
MCAutoStringRef t_string;
1021-
if (!ctxt . HasError())
1022-
{
1023-
/* UNCHECKED */ ctxt . EvalExprAsStringRef(m_filename, EE_UNDEFINED, &t_string);
1024-
}
1025-
1026-
if (!ctxt . HasError())
1022+
if (!ctxt . HasError()
1023+
&& ctxt . EvalExprAsStringRef(m_filename, EE_UNDEFINED, &t_string))
10271024
{
10281025
MCAutoPointer<char> temp;
10291026
if (!MCStringConvertToCString(*t_string, &temp))

engine/src/ibmp.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,8 +2711,9 @@ bool MCXWDImageLoader::LoadHeader(uint32_t &r_width, uint32_t &r_height, uint32_
27112711
char *newname = nil;
27122712

27132713
if (t_success)
2714-
t_success = nil != (newname = new char[namesize]) &&
2715-
IO_read(newname, namesize, stream) == IO_NORMAL;
2714+
// SN-2015-06-19: [[ CID 48071 ]] Use MCMemoryNewArray for consistency
2715+
t_success = MCMemoryNewArray(namesize, newname)
2716+
&& IO_read(newname, namesize, stream) == IO_NORMAL;
27162717

27172718
if (t_success)
27182719
{

engine/src/player-legacy.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2002,7 +2002,8 @@ void MCPlayer::getenabledtracks(uindex_t &r_count, uint32_t *&r_tracks_id)
20022002
#elif defined(X11)
20032003
x11_getenabledtracks(t_count, t_tracks_id);
20042004
#else
2005-
0 == 0;
2005+
// SN-2015-06-19: [[ CID 100295 ]] Use brackets instead of true assertion
2006+
{}
20062007
#endif
20072008

20082009
r_count = t_count;

0 commit comments

Comments
 (0)