From: Dave Airlie Date: Mon, 12 Jun 2017 19:50:18 +0000 (+1000) Subject: u_dynarray: fix coverity warning about ignoring return value from reralloc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca69b5e78c49be2474dab7be92161cd9f957c4e7;p=mesa.git 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 Reviewed-by: Samuel Pitoiset Signed-off-by: Dave Airlie --- diff --git a/src/util/u_dynarray.h b/src/util/u_dynarray.h index e9109ccd2d1..fdcd09c4bef 100644 --- a/src/util/u_dynarray.h +++ b/src/util/u_dynarray.h @@ -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); }