MXS-1740 Hintfilter leaks memory

Single spot where an existing hint ptr was overwritten. Removed gwbuf_add_hint()
because it was  adding hints at the opposite end compared to functions in hint.h.
Added hint_splice() to replace.
This commit is contained in:
Niclas Antti
2018-05-30 09:45:17 +03:00
parent 8917458505
commit 89296ed4e4
6 changed files with 32 additions and 37 deletions

View File

@ -814,28 +814,6 @@ gwbuf_make_contiguous(GWBUF *orig)
return newbuf;
}
void
gwbuf_add_hint(GWBUF *buf, HINT *hint)
{
HINT *ptr;
spinlock_acquire(&buf->gwbuf_lock);
if (buf->hint)
{
ptr = buf->hint;
while (ptr->next)
{
ptr = ptr->next;
}
ptr->next = hint;
}
else
{
buf->hint = hint;
}
spinlock_release(&buf->gwbuf_lock);
}
size_t gwbuf_copy_data(const GWBUF *buffer, size_t offset, size_t bytes, uint8_t* dest)
{
uint32_t buflen;