GBE: fix a potential memory leak bug.
authorZhigang Gong <zhigang.gong@intel.com>
Thu, 11 Sep 2014 05:45:33 +0000 (13:45 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Thu, 11 Sep 2014 05:48:47 +0000 (13:48 +0800)
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
backend/src/backend/program.cpp

index bd194a7..06c22ac 100644 (file)
@@ -116,6 +116,7 @@ namespace gbe {
     if (llvmToGen(*unit, fileName, module, optLevel, OCL_STRICT_CONFORMANCE) == false) {
       if (fileName)
         error = std::string(fileName) + " not found";
+      delete unit;
       return false;
     }
     //If unit is not valid, maybe some thing don't support by backend, introduce by some passes