Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
65c0cb48
Commit
65c0cb48
authored
Apr 24, 2015
by
Alexandre Duret-Lutz
Browse files
tmpfile: fix out-of-memory check
another catch by cppcheck * src/misc/tmpfile.cc: Here.
parent
340557a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/misc/tmpfile.cc
View file @
65c0cb48
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Développement
// Copyright (C) 2013
, 2015
Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
...
...
@@ -52,10 +52,9 @@ namespace spot
size_t
slen
=
0
;
if
(
suffix
)
len
+=
slen
=
strlen
(
suffix
);
*
name
=
static_cast
<
char
*>
(
malloc
(
tmpdirlen
+
1
+
len
+
6
+
1
));
if
(
!
name
)
char
*
x
=
*
name
=
static_cast
<
char
*>
(
malloc
(
tmpdirlen
+
1
+
len
+
6
+
1
));
if
(
!
x
)
throw
std
::
bad_alloc
();
char
*
x
=
*
name
;
if
(
tmpdir
)
{
x
=
stpcpy
(
x
,
tmpdir
);
...
...
@@ -147,4 +146,3 @@ namespace spot
delete
to_clean
.
front
();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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