diff options
author | Chen-Pang He <jdh8@ms63.hinet.net> | 2012-09-07 15:21:57 +0800 |
---|---|---|
committer | Chen-Pang He <jdh8@ms63.hinet.net> | 2012-09-07 15:21:57 +0800 |
commit | 145f89cd5f8872bfe8bceae127a2421576767e08 (patch) | |
tree | 3cd2f3ac2aa1412b9a9ebafe3248a4884f8c0c89 /blas/double.cpp | |
parent | c86d047c2f83d335d2d126079d53d6925db01740 (diff) |
Fix memory leak in DSDOT.
Diffstat (limited to 'blas/double.cpp')
-rw-r--r-- | blas/double.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/blas/double.cpp b/blas/double.cpp index 9b53be484..8a3b00175 100644 --- a/blas/double.cpp +++ b/blas/double.cpp @@ -31,8 +31,13 @@ double* cast_vector_to_double(float* x, int n, int incx) double BLASFUNC(dsdot)(int* n, float* px, int* incx, float* py, int* incy) { if(*n <= 0) return 0; + double* x = cast_vector_to_double(px, *n, *incx); double* y = cast_vector_to_double(py, *n, *incy); - return vector(x,*n).cwiseProduct(vector(y,*n)).sum(); + double res = vector(x,*n).cwiseProduct(vector(y,*n)).sum(); + + delete[] x; + delete[] y; + return res; } |