Commit e4f312d3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Eliminate use of strndup(), in this case the length is known to match

precisely.
parent f06aa9fd
......@@ -49,10 +49,6 @@
#include "varnishapi.h"
#include "vss.h"
#ifndef HAVE_STRNDUP
#include "compat/strndup.h"
#endif
#define freez(x) do { if (x) free(x); x = NULL; } while (0);
static struct vss_addr *addr_info;
......@@ -661,7 +657,9 @@ gen_traffic(void *priv, enum vsl_tag tag, unsigned fd,
msg = malloc(sizeof (struct message));
msg->tag = tag;
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);
return (0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment