diff --git a/12_StringPathInMatrix/StringPathInMatrix.cpp b/12_StringPathInMatrix/StringPathInMatrix.cpp index 7e4e0b7..1ce56e6 100644 --- a/12_StringPathInMatrix/StringPathInMatrix.cpp +++ b/12_StringPathInMatrix/StringPathInMatrix.cpp @@ -47,6 +47,7 @@ bool hasPath(const char* matrix, int rows, int cols, const char* str) if(hasPathCore(matrix, rows, cols, row, col, str, pathLength, visited)) { + delete[] visited; return true; } }