Index: /issm/trunk-jpl/src/c/shared/Numerics/legendre.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/legendre.cpp	(revision 20030)
+++ /issm/trunk-jpl/src/c/shared/Numerics/legendre.cpp	(revision 20031)
@@ -140,5 +140,5 @@
 #include "./recast.h"
 
-double *p_polynomial_value ( int m, int n, IssmDouble* x){
+IssmDouble* p_polynomial_value ( int m, int n, IssmDouble* x){
 
 	/******************************************************************************{{{/
@@ -241,11 +241,10 @@
 	}}}*/
 	
-	int i;
+	int i,j;
 	int j;
-	IssmDouble* v=NULL;
-
-	if ( n < 0 ) return NULL;
-
-	v = xNew<IssmDouble>(m*(n+1));
+
+	if(n<0) return NULL;
+
+	IssmDouble* v = xNew<IssmDouble>(m*(n+1));
 
 	for ( i = 0; i < m; i++ ) v[i*(n+1)+0] = 1.0;
