Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Libraries
nghttp2
Commits
cfee9cab
Commit
cfee9cab
authored
Aug 23, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid possible double-free and make nghttp2_buf{s}_free(NULL) success
parent
679a0a0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
lib/nghttp2_buf.c
lib/nghttp2_buf.c
+16
-0
No files found.
lib/nghttp2_buf.c
View file @
cfee9cab
...
...
@@ -45,7 +45,12 @@ int nghttp2_buf_init2(nghttp2_buf *buf, size_t initial)
void
nghttp2_buf_free
(
nghttp2_buf
*
buf
)
{
if
(
buf
==
NULL
)
{
return
;
}
free
(
buf
->
begin
);
buf
->
begin
=
NULL
;
}
int
nghttp2_buf_reserve
(
nghttp2_buf
*
buf
,
size_t
new_cap
)
...
...
@@ -168,6 +173,10 @@ void nghttp2_bufs_free(nghttp2_bufs *bufs)
{
nghttp2_buf_chain
*
chain
,
*
next_chain
;
if
(
bufs
==
NULL
)
{
return
;
}
for
(
chain
=
bufs
->
head
;
chain
;)
{
next_chain
=
chain
->
next
;
...
...
@@ -175,6 +184,8 @@ void nghttp2_bufs_free(nghttp2_bufs *bufs)
chain
=
next_chain
;
}
bufs
->
head
=
NULL
;
}
int
nghttp2_bufs_wrap_init
(
nghttp2_bufs
*
bufs
,
uint8_t
*
begin
,
size_t
len
)
...
...
@@ -205,7 +216,12 @@ int nghttp2_bufs_wrap_init(nghttp2_bufs *bufs, uint8_t *begin, size_t len)
void
nghttp2_bufs_wrap_free
(
nghttp2_bufs
*
bufs
)
{
if
(
bufs
==
NULL
)
{
return
;
}
free
(
bufs
->
head
);
bufs
->
head
=
NULL
;
}
void
nghttp2_bufs_seek_last_present
(
nghttp2_bufs
*
bufs
)
...
...
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