summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-06-13 05:50:18 +1000
committerDave Airlie <airlied@redhat.com>2017-06-13 06:40:25 +1000
commitca69b5e78c49be2474dab7be92161cd9f957c4e7 (patch)
treeb46585d05a200ce1611dc92908a28b162f9ba0b5 /src/util
parent53587b7105aaf10ecf7e5dcb8ed63265af688738 (diff)
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>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/u_dynarray.h2
1 files changed, 1 insertions, 1 deletions
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);
}