Fix a regression with SA-15:24 patch that prevented NIS from
working.
This commit is contained in:
parent
d847071cf6
commit
0ed633d0f8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=288510
@ -1052,12 +1052,15 @@ static bool_t
|
||||
netbuf_copybuf(struct netbuf *dst, const struct netbuf *src)
|
||||
{
|
||||
|
||||
assert(dst->buf == NULL);
|
||||
|
||||
if (dst->len != src->len || dst->buf == NULL) {
|
||||
if (dst->buf != NULL)
|
||||
free(dst->buf);
|
||||
if ((dst->buf = malloc(src->len)) == NULL)
|
||||
return (FALSE);
|
||||
|
||||
dst->maxlen = dst->len = src->len;
|
||||
}
|
||||
|
||||
memcpy(dst->buf, src->buf, src->len);
|
||||
return (TRUE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user