Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
f49d8571
Commit
f49d8571
authored
Nov 14, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up and avoid leak in sap decompression
parent
6154f386
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+6
-8
No files found.
modules/services_discovery/sap.c
View file @
f49d8571
...
...
@@ -1208,13 +1208,11 @@ static int InitSocket( services_discovery_t *p_sd, const char *psz_address,
static
int
Decompress
(
const
unsigned
char
*
psz_src
,
unsigned
char
**
_dst
,
int
i_len
)
{
#ifdef HAVE_ZLIB_H
int
i_result
,
i_dstsize
,
n
;
unsigned
char
*
psz_dst
;
int
i_result
,
i_dstsize
,
n
=
0
;
unsigned
char
*
psz_dst
=
NULL
;
z_stream
d_stream
;
d_stream
.
zalloc
=
(
alloc_func
)
0
;
d_stream
.
zfree
=
(
free_func
)
0
;
d_stream
.
opaque
=
(
voidpf
)
0
;
memset
(
&
d_stream
,
0
,
sizeof
(
d_stream
));
i_result
=
inflateInit
(
&
d_stream
);
if
(
i_result
!=
Z_OK
)
...
...
@@ -1222,9 +1220,6 @@ static int Decompress( const unsigned char *psz_src, unsigned char **_dst, int i
d_stream
.
next_in
=
(
Bytef
*
)
psz_src
;
d_stream
.
avail_in
=
i_len
;
n
=
0
;
psz_dst
=
NULL
;
do
{
...
...
@@ -1235,8 +1230,11 @@ static int Decompress( const unsigned char *psz_src, unsigned char **_dst, int i
i_result
=
inflate
(
&
d_stream
,
Z_NO_FLUSH
);
if
(
(
i_result
!=
Z_OK
)
&&
(
i_result
!=
Z_STREAM_END
)
)
{
inflateEnd
(
&
d_stream
);
return
(
-
1
);
}
}
while
(
(
d_stream
.
avail_out
==
0
)
&&
(
d_stream
.
avail_in
!=
0
)
&&
(
i_result
!=
Z_STREAM_END
)
);
...
...
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