[Beignet] [PATCH] Fix two memory leak.
Chuanbo Weng
chuanbo.weng at intel.com
Tue Oct 22 02:11:56 PDT 2013
Signed-off-by: Chuanbo Weng <chuanbo.weng at intel.com>
---
backend/src/backend/program.cpp | 1 +
src/intel/intel_driver.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
index b2879a4..2ed971b 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -549,6 +549,7 @@ namespace gbe {
}
Args[NumArgs + 1] = 0;
llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args);
+ delete [] Args;
}
// Create an action and make the compiler instance carry it out
diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
index 9d6bbe8..cfbb302 100644
--- a/src/intel/intel_driver.c
+++ b/src/intel/intel_driver.c
@@ -56,6 +56,7 @@
#include "intel_gpgpu.h"
#include "intel_batchbuffer.h"
#include "intel_bufmgr.h"
+#include <X11/Xlibint.h>
#include "x11/dricommon.h"
#include "cl_mem.h"
@@ -192,8 +193,10 @@ intel_driver_open(intel_driver_t *intel, cl_context_prop props)
if(intel->x11_display) {
if((intel->dri_ctx = getDRI2State(intel->x11_display,
DefaultScreen(intel->x11_display),
- &driver_name)))
+ &driver_name))) {
intel_driver_init_shared(intel, intel->dri_ctx);
+ Xfree(driver_name);
+ }
else
printf("X server found. dri2 connection failed! \n");
} else {
--
1.7.9.5
More information about the Beignet
mailing list