Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Iker Martín Álvarez
Proteo
Commits
2c244a3f
Commit
2c244a3f
authored
Jan 08, 2024
by
iker_martin
Browse files
Fixed mem free bug in adr and sdr arrays for target processes
parent
3b51a4e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Codes/Main/Main.c
View file @
2c244a3f
...
...
@@ -117,24 +117,33 @@ int main(int argc, char *argv[]) {
if
(
config_file
->
sdr
)
{
malleability_get_entries
(
&
entries
,
0
,
1
);
group
->
sync_qty
=
(
int
*
)
malloc
(
entries
*
sizeof
(
int
));
group
->
sync_array
=
(
char
**
)
malloc
(
entries
*
sizeof
(
char
*
));
for
(
i
=
0
;
i
<
entries
;
i
++
)
{
malleability_get_data
(
&
value
,
i
,
0
,
1
);
group
->
sync_array
[
i
]
=
(
char
*
)
value
;
group
->
sync_qty
[
i
]
=
DR_MAX_SIZE
;
}
group
->
sync_qty
[
entries
-
1
]
=
config_file
->
sdr
%
DR_MAX_SIZE
?
config_file
->
sdr
%
DR_MAX_SIZE
:
DR_MAX_SIZE
;
group
->
sync_data_groups
=
entries
;
}
if
(
config_file
->
adr
)
{
malleability_get_entries
(
&
entries
,
0
,
0
);
group
->
async_qty
=
(
int
*
)
malloc
(
entries
*
sizeof
(
int
));
group
->
async_array
=
(
char
**
)
malloc
(
entries
*
sizeof
(
char
*
));
for
(
i
=
0
;
i
<
entries
;
i
++
)
{
malleability_get_data
(
&
value
,
i
,
0
,
0
);
group
->
async_array
[
i
]
=
(
char
*
)
value
;
group
->
async_qty
[
i
]
=
DR_MAX_SIZE
;
}
group
->
async_qty
[
entries
-
1
]
=
config_file
->
adr
%
DR_MAX_SIZE
?
config_file
->
adr
%
DR_MAX_SIZE
:
DR_MAX_SIZE
;
group
->
async_data_groups
=
entries
;
}
group
->
grp
=
group
->
grp
+
1
;
results
=
malloc
(
sizeof
(
results_data
));
init_results_data
(
results
,
config_file
->
n_resizes
,
config_file
->
n_stages
,
config_file
->
groups
[
group
->
grp
].
iters
);
}
//
...
...
Write
Preview
Supports
Markdown
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