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
codes
codes
Commits
cd7648d7
Commit
cd7648d7
authored
Aug 08, 2013
by
Philip Carns
Browse files
fix some memory leaks (clang static analysis)
parent
7efe61bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/util/lp-io.c
View file @
cd7648d7
...
...
@@ -262,7 +262,6 @@ static int write_id(char* directory, char* identifier, MPI_Comm comm)
char
err_string
[
MPI_MAX_ERROR_STRING
];
int
err_len
;
MPI_Datatype
mtype
;
void
**
pointers
;
int
*
lengths
;
MPI_Aint
*
displacements
;
MPI_Aint
base
;
...
...
@@ -292,8 +291,6 @@ static int write_id(char* directory, char* identifier, MPI_Comm comm)
/* build datatype for our buffers */
if
(
id
)
{
pointers
=
malloc
(
id
->
buffers_count
*
sizeof
(
void
*
));
assert
(
pointers
);
lengths
=
malloc
(
id
->
buffers_count
*
sizeof
(
int
));
assert
(
lengths
);
displacements
=
malloc
(
id
->
buffers_count
*
sizeof
(
MPI_Aint
));
...
...
@@ -319,6 +316,8 @@ static int write_id(char* directory, char* identifier, MPI_Comm comm)
MPI_Type_hindexed
(
id
->
buffers_count
,
lengths
,
displacements
,
MPI_BYTE
,
&
mtype
);
MPI_Type_commit
(
&
mtype
);
free
(
lengths
);
free
(
displacements
);
ret
=
MPI_File_write_at_all
(
fh
,
my_offset
,
id
->
buffers
->
buffer
,
1
,
mtype
,
&
status
);
...
...
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