avoid shadowing warnings
diff --git a/THCCachingAllocator.cpp b/THCCachingAllocator.cpp
index 85cafd4..eeae04a 100644
--- a/THCCachingAllocator.cpp
+++ b/THCCachingAllocator.cpp
@@ -112,7 +112,7 @@
     } else {
       void* ptr;
       size_t alloc_size = small ? kSmallAlloc : size;
-      cudaError_t err = cuda_malloc_retry(device, &ptr, alloc_size);
+      err = cuda_malloc_retry(device, &ptr, alloc_size);
       if (err != cudaSuccess) {
         return err;
       }