Mesa (master): r600/llvm: Free binary.code/binary. config in r600_llvm_compile

Tom Stellard tstellar at kemper.freedesktop.org
Fri Nov 15 17:55:21 UTC 2013


Module: Mesa
Branch: master
Commit: 01f3622c740173d4001eb421b74d4d60a0c7fd12
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=01f3622c740173d4001eb421b74d4d60a0c7fd12

Author: Aaron Watry <awatry at gmail.com>
Date:   Thu Nov 14 12:17:43 2013 -0600

r600/llvm: Free binary.code/binary.config in r600_llvm_compile

radeon_llvm_compile allocates memory for binary.code, binary.config,
or neither depending on what's being done.

We need to make sure to free that memory after it's no longer needed.

v2: Don't bother checking for null before FREE()

CC: "10.0" <mesa-stable at lists.freedesktop.org>

---

 src/gallium/drivers/r600/r600_llvm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c
index f6784eb..6860faa 100644
--- a/src/gallium/drivers/r600/r600_llvm.c
+++ b/src/gallium/drivers/r600/r600_llvm.c
@@ -864,6 +864,9 @@ unsigned r600_llvm_compile(
 		}
 	}
 
+	FREE(binary.code);
+	FREE(binary.config);
+
 	return r;
 }
 




More information about the mesa-commit mailing list