u_dynarray: fix coverity warning about ignoring return value from reralloc

>>>     Ignoring storage allocated by "reralloc_size(buf->mem_ctx, buf->data, buf->size)" leaks it.

Reviewed-by: Thomas Helland<thomashelland90@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie 2017-06-13 05:50:18 +10:00
parent 53587b7105
commit ca69b5e78c

View file

@ -107,7 +107,7 @@ util_dynarray_trim(struct util_dynarray *buf)
if (buf->size != buf->capacity) {
if (buf->size) {
if (buf->mem_ctx) {
reralloc_size(buf->mem_ctx, buf->data, buf->size);
buf->data = reralloc_size(buf->mem_ctx, buf->data, buf->size);
} else {
buf->data = realloc(buf->data, buf->size);
}