free build_log when the cl program is released
authorGuo Yejun <yejun.guo@intel.com>
Thu, 17 Jul 2014 18:38:33 +0000 (02:38 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Fri, 18 Jul 2014 01:51:30 +0000 (09:51 +0800)
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
src/cl_program.c

index 3fc2212..7d33f2a 100644 (file)
@@ -76,6 +76,11 @@ cl_program_delete(cl_program p)
     p->build_opts = NULL;
   }
 
+  if (p->build_log) {
+    free(p->build_log);
+    p->build_log = NULL;
+  }
+
   /* Remove it from the list */
   assert(p->ctx);
   pthread_mutex_lock(&p->ctx->program_lock);