Explorar o código

Fixed wrong memory allocation, detected and reported by Eva Stopkova.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58748 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert %!s(int64=11) %!d(string=hai) anos
pai
achega
57d2ec28ac
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/gmath/la.c

+ 1 - 1
lib/gmath/la.c

@@ -483,7 +483,7 @@ G_matrix_LU_solve(const mat_struct * mt1, mat_struct ** xmat0,
 	    integer *perm, res_info;
 	    integer num_eqns, nrhs, lda, ldb;
 
-	    perm = (integer *) G_malloc(wmat->rows);
+	    perm = (integer *) G_malloc(wmat->rows * sizeof(integer));
 
 	    /* Set fields to pass to fortran routine */
 	    num_eqns = (integer) mt1->rows;