[arrayfire] 129/408: BUGFIX: Check for NULL values when allocating memory on CPU backend

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:11:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.

commit a5efdea9d0fea204ee258db05971c343ff9e844d
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Fri Jul 10 09:58:13 2015 -0400

    BUGFIX: Check for NULL values when allocating memory on CPU backend
---
 src/backend/cpu/memory.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/backend/cpu/memory.cpp b/src/backend/cpu/memory.cpp
index 18a14c0..c2a1441 100644
--- a/src/backend/cpu/memory.cpp
+++ b/src/backend/cpu/memory.cpp
@@ -139,6 +139,10 @@ namespace cpu
             // Perform garbage collection if memory can not be allocated
             ptr = (T *)malloc(alloc_bytes);
 
+            if (ptr == NULL) {
+                AF_ERROR("Can not allocate memory", AF_ERR_NO_MEM);
+            }
+
             mem_info info = {false, false, alloc_bytes};
             memory_map[ptr] = info;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list