projects
/
cvc5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87fa456
)
Quashing memory leak
author
Chad Brewbaker
<chad@flyingdogsolutions.com>
Wed, 11 Jan 2017 02:51:24 +0000
(20:51 -0600)
committer
Chad Brewbaker
<chad@flyingdogsolutions.com>
Wed, 11 Jan 2017 02:51:24 +0000
(20:51 -0600)
src/base/cvc4_assert.cpp
patch
|
blob
|
history
diff --git
a/src/base/cvc4_assert.cpp
b/src/base/cvc4_assert.cpp
index 8d5b9e50844c67a7771218e40d5cc2414ad255e1..9d578dc07baed5ea2e4a1aa8380d9836d9f23859 100644
(file)
--- a/
src/base/cvc4_assert.cpp
+++ b/
src/base/cvc4_assert.cpp
@@
-38,10
+38,10
@@
void AssertionException::construct(const char* header, const char* extra,
// then with a larger one if sprintf tells us to.
int n = 512;
char* buf;
+ buf = new char[n];
for(;;) {
- buf = new char[n];
-
+
int size;
if(extra == NULL) {
size = snprintf(buf, n, "%s\n%s\n%s:%d\n",
@@
-66,6
+66,7
@@
void AssertionException::construct(const char* header, const char* extra,
// try again with a buffer that's large enough
n = size + 1;
delete [] buf;
+ buf = new char[n];
}
}