diff --git a/modules/flann/include/opencv2/flann/allocator.h b/modules/flann/include/opencv2/flann/allocator.h
index cc571e460..a5f7c0cd2 100644
--- a/modules/flann/include/opencv2/flann/allocator.h
+++ b/modules/flann/include/opencv2/flann/allocator.h
@@ -119,7 +119,7 @@ public:
 	 * Returns a pointer to a piece of new memory of the given size in bytes
 	 * allocated from the pool.
 	 */
-	void* malloc(int size)
+	void* allocateBytes(int size)
 	{
 		int blocksize;
 
@@ -176,7 +176,7 @@ public:
     template <typename T>
 	T* allocate(size_t count = 1)
 	{
-		T* mem = (T*) this->malloc(sizeof(T)*count);
+		T* mem = (T*) this->allocateBytes(sizeof(T)*count);
 		return mem;
 	}
 
diff --git a/modules/flann/include/opencv2/flann/autotuned_index.h b/modules/flann/include/opencv2/flann/autotuned_index.h
index 4cc582904..89e909cd6 100644
--- a/modules/flann/include/opencv2/flann/autotuned_index.h
+++ b/modules/flann/include/opencv2/flann/autotuned_index.h
@@ -527,9 +527,9 @@ private:
             bestCost = kdtreeCost.first.totalCost;
         }
 
-        gt_matches.free();
-        sampledDataset.free();
-        testDataset.free();
+        gt_matches.release();
+        sampledDataset.release();
+        testDataset.release();
 
         return bestParams;
     }
@@ -601,7 +601,7 @@ private:
 
             speedup = linear/searchTime;
 
-            gt_matches.free();
+            gt_matches.release();
         }
 
         return speedup;
diff --git a/modules/flann/include/opencv2/flann/matrix.h b/modules/flann/include/opencv2/flann/matrix.h
index 590df890a..170dc6ddc 100644
--- a/modules/flann/include/opencv2/flann/matrix.h
+++ b/modules/flann/include/opencv2/flann/matrix.h
@@ -62,7 +62,7 @@ public:
     /**
      * Convenience function for deallocating the storage data.
      */
-    void free()
+    void release()
     {
         if (data!=NULL) delete[] data;
     }