Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
system_extras
Commits
43b28bc6
Commit
43b28bc6
authored
8 years ago
by
Treehugger Robot
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Download
Plain Diff
Merge "fix warning: Potential leak of memory pointed to by 'bench'"
parents
20eac2aa
d31537bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
tests/memtest/bandwidth.cpp
tests/memtest/bandwidth.cpp
+1
-0
tests/memtest/bandwidth.h
tests/memtest/bandwidth.h
+2
-0
No files found.
tests/memtest/bandwidth.cpp
View file @
43b28bc6
...
...
@@ -138,6 +138,7 @@ BandwidthBenchmark *createBandwidthBenchmarkObject(arg_t values) {
if
(
!
bench
->
setSize
(
size
))
{
printf
(
"Failed to allocate buffers for benchmark.
\n
"
);
delete
bench
;
return
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
tests/memtest/bandwidth.h
View file @
43b28bc6
...
...
@@ -105,9 +105,11 @@ public:
bool
setSize
(
size_t
size
)
{
if
(
_src
)
{
free
(
_src
);
_src
=
NULL
;
}
if
(
_dst
)
{
free
(
_dst
);
_dst
=
NULL
;
}
if
(
size
==
0
)
{
...
...
This diff is collapsed.
Click to expand it.
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