Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmp_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
281a9a28
Commit
281a9a28
authored
3 years ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
Prevent memory leak
parent
b561e14f
No related branches found
No related tags found
1 merge request
!7
Fix a bug in the definition in imagette header
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmp_tool.c
+2
-2
2 additions, 2 deletions
cmp_tool.c
lib/cmp_tool_lib.c
+1
-5
1 addition, 5 deletions
lib/cmp_tool_lib.c
with
3 additions
and
7 deletions
cmp_tool.c
+
2
−
2
View file @
281a9a28
...
@@ -384,7 +384,7 @@ int main(int argc, char **argv)
...
@@ -384,7 +384,7 @@ int main(int argc, char **argv)
print_cmp_info
(
&
info
);
print_cmp_info
(
&
info
);
/* we reuse the entity buffer for the compressed data */
/* we reuse the entity buffer for the compressed data */
cmp_data_adr
=
(
uint32_t
*
)
ent
;
cmp_data_adr
=
(
uint32_t
*
)
decomp_input_buf
;
size
=
cmp_ent_get_cmp_data
(
ent
,
cmp_data_adr
,
buf_size
);
size
=
cmp_ent_get_cmp_data
(
ent
,
cmp_data_adr
,
buf_size
);
ent
=
NULL
;
ent
=
NULL
;
if
(
size
<
0
)
if
(
size
<
0
)
...
...
This diff is collapsed.
Click to expand it.
lib/cmp_tool_lib.c
+
1
−
5
View file @
281a9a28
...
@@ -96,11 +96,7 @@ static FILE *open_file(const char *dirname, const char *filename)
...
@@ -96,11 +96,7 @@ static FILE *open_file(const char *dirname, const char *filename)
}
}
errno
=
0
;
errno
=
0
;
pathname
=
(
char
*
)
malloc
((
size_t
)
n
+
1
);
pathname
=
(
char
*
)
alloca
((
size_t
)
n
+
1
);
if
(
!
pathname
)
{
perror
(
"malloc failed"
);
abort
();
}
errno
=
0
;
errno
=
0
;
n
=
snprintf
(
pathname
,
(
size_t
)
n
+
1
,
"%s%s"
,
dirname
,
filename
);
n
=
snprintf
(
pathname
,
(
size_t
)
n
+
1
,
"%s%s"
,
dirname
,
filename
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment