Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishevent3
Commits
e4f312d3
Commit
e4f312d3
authored
May 12, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate use of strndup(), in this case the length is known to match
precisely.
parent
f06aa9fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
varnishreplay.c
bin/varnishreplay/varnishreplay.c
+3
-5
No files found.
bin/varnishreplay/varnishreplay.c
View file @
e4f312d3
...
@@ -49,10 +49,6 @@
...
@@ -49,10 +49,6 @@
#include "varnishapi.h"
#include "varnishapi.h"
#include "vss.h"
#include "vss.h"
#ifndef HAVE_STRNDUP
#include "compat/strndup.h"
#endif
#define freez(x) do { if (x) free(x); x = NULL; } while (0);
#define freez(x) do { if (x) free(x); x = NULL; } while (0);
static
struct
vss_addr
*
addr_info
;
static
struct
vss_addr
*
addr_info
;
...
@@ -661,7 +657,9 @@ gen_traffic(void *priv, enum vsl_tag tag, unsigned fd,
...
@@ -661,7 +657,9 @@ gen_traffic(void *priv, enum vsl_tag tag, unsigned fd,
msg
=
malloc
(
sizeof
(
struct
message
));
msg
=
malloc
(
sizeof
(
struct
message
));
msg
->
tag
=
tag
;
msg
->
tag
=
tag
;
msg
->
len
=
len
;
msg
->
len
=
len
;
msg
->
ptr
=
strndup
(
ptr
,
len
);
msg
->
ptr
=
malloc
(
len
);
AN
(
msg
->
ptr
);
memcpy
(
msg
->
ptr
,
ptr
,
len
);
mailbox_put
(
&
thr
->
mbox
,
msg
);
mailbox_put
(
&
thr
->
mbox
,
msg
);
return
(
0
);
return
(
0
);
...
...
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