[Beignet] [PATCH] Fix two memory leak.
Xing, Homer
homer.xing at intel.com
Mon Oct 21 18:30:24 PDT 2013
This patch looks good to me. Good.
Homer
-----Original Message-----
From: beignet-bounces+homer.xing=intel.com at lists.freedesktop.org [mailto:beignet-bounces+homer.xing=intel.com at lists.freedesktop.org] On Behalf Of Chuanbo Weng
Sent: Tuesday, October 22, 2013 5:12 PM
To: beignet at lists.freedesktop.org
Cc: Zou, Nanhai; Gong, Zhigang; Weng, Chuanbo
Subject: [Beignet] [PATCH] Fix two memory leak.
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
_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list