Commit e50d3809 authored by Mathieu Faverge's avatar Mathieu Faverge

Silent warnign about memory leaks

parent fd22c60c
...@@ -83,7 +83,10 @@ int testing_zgeadd(int argc, char **argv) ...@@ -83,7 +83,10 @@ int testing_zgeadd(int argc, char **argv)
MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ((!A)||(!B)||(!Binit)||(!Bfinal)){ if ( (!A) || (!B) || (!Binit) || (!Bfinal) )
{
free(A); free(B);
free(Binit); free(Bfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -258,7 +258,11 @@ int testing_zgels(int argc, char **argv) ...@@ -258,7 +258,11 @@ int testing_zgels(int argc, char **argv)
MORSE_desc_t *T; MORSE_desc_t *T;
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){ if ( (!A1) || (!A2) || (!B1) || (!B2) || (!Q) )
{
free(A1); free(A2);
free(B1); free(B2);
free(Q);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -95,7 +95,11 @@ int testing_zgels_hqr(int argc, char **argv) ...@@ -95,7 +95,11 @@ int testing_zgels_hqr(int argc, char **argv)
MORSE_desc_t *TT = NULL; MORSE_desc_t *TT = NULL;
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){ if ( (!A1) || (!A2) || (!B1) || (!B2) || (!Q) )
{
free(A1); free(A2);
free(B1); free(B2);
free(Q);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -89,7 +89,11 @@ int testing_zgels_systolic(int argc, char **argv) ...@@ -89,7 +89,11 @@ int testing_zgels_systolic(int argc, char **argv)
MORSE_desc_t *TT = NULL; MORSE_desc_t *TT = NULL;
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){ if ( (!A1) || (!A2) || (!B1) || (!B2) || (!Q) )
{
free(A1); free(A2);
free(B1); free(B2);
free(Q);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -88,7 +88,10 @@ int testing_zgemm(int argc, char **argv) ...@@ -88,7 +88,10 @@ int testing_zgemm(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){ if ( (!A) || (!B) || (!Cinit) || (!Cfinal) )
{
free(A); free(B);
free(Cinit); free(Cfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -87,6 +87,8 @@ int testing_zgeqrf_qdwh(int argc, char **argv) ...@@ -87,6 +87,8 @@ int testing_zgeqrf_qdwh(int argc, char **argv)
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A) || (!A1) || (!A2) || (!Q1) || (!Q2) ){ if ( (!A) || (!A1) || (!A2) || (!Q1) || (!Q2) ){
free(A); free(A1); free(A2);
free(Q1); free(Q2);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -196,7 +196,10 @@ int testing_zgesv_incpiv(int argc, char **argv) ...@@ -196,7 +196,10 @@ int testing_zgesv_incpiv(int argc, char **argv)
int *IPIV; int *IPIV;
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A1) || (!A2)|| (!B1) || (!B2) ) { if ( (!A1) || (!A2)|| (!B1) || (!B2) )
{
free(A1); free(A2);
free(B1); free(B2);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -100,6 +100,8 @@ int testing_zgesvd(int argc, char **argv) ...@@ -100,6 +100,8 @@ int testing_zgesvd(int argc, char **argv)
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A1) || (!S1) || (!S2) || (!work) ) { if ( (!A1) || (!S1) || (!S2) || (!work) ) {
free(A1); free(work);
free(S1); free(S2);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -72,7 +72,11 @@ int testing_zheevd(int argc, char **argv) ...@@ -72,7 +72,11 @@ int testing_zheevd(int argc, char **argv)
MORSE_desc_t *T; MORSE_desc_t *T;
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A2) || (!W1) || (!W2) ){ if ( (!A2) || (!W1) || (!W2) || !(work) )
{
free(A2);
free(W1); free(W2);
free(work);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -81,7 +81,10 @@ int testing_zhemm(int argc, char **argv) ...@@ -81,7 +81,10 @@ int testing_zhemm(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){ if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) )
{
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -82,7 +82,9 @@ int testing_zher2k(int argc, char **argv) ...@@ -82,7 +82,9 @@ int testing_zher2k(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) ){ if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) ){
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -77,7 +77,9 @@ int testing_zherk(int argc, char **argv) ...@@ -77,7 +77,9 @@ int testing_zherk(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A) || (!Cinit) || (!Cfinal) ){ if ( (!A) || (!C) || (!Cinit) || (!Cfinal) ){
free(A); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -134,9 +134,12 @@ int testing_zpemv(int argc, char **argv) ...@@ -134,9 +134,12 @@ int testing_zpemv(int argc, char **argv)
LAPACKE_zlarnv_work(1, ISEED, 1, &beta0 ); LAPACKE_zlarnv_work(1, ISEED, 1, &beta0 );
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A) || (!X) || (!Y0) || (!work) ) { if ( (!A) || (!A0) || (!X) || (!Y) || (!Y0) || (!work) ) {
free(A); free(A0);
free(X); free(Y); free(Y0);
free(work);
printf("Out of Memory \n "); printf("Out of Memory \n ");
exit(0); return -2;
} }
/* Initialize Data */ /* Initialize Data */
......
...@@ -189,13 +189,16 @@ int testing_zposv(int argc, char **argv) ...@@ -189,13 +189,16 @@ int testing_zposv(int argc, char **argv)
int info_solution, info_factorization; int info_solution, info_factorization;
int trans1, trans2; int trans1, trans2;
MORSE_Complex64_t *A1 = (MORSE_Complex64_t *)malloc(LDA*N*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *A1 = (MORSE_Complex64_t *)malloc(LDA*N*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *A2 = (MORSE_Complex64_t *)malloc(LDA*N*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *A2 = (MORSE_Complex64_t *)malloc(LDA*N*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *B1 = (MORSE_Complex64_t *)malloc(LDB*NRHS*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *B1 = (MORSE_Complex64_t *)malloc(LDB*NRHS*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *B2 = (MORSE_Complex64_t *)malloc(LDB*NRHS*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *B2 = (MORSE_Complex64_t *)malloc(LDB*NRHS*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)){ if ( (!A1) || (!A2)|| (!B1) || (!B2) )
{
free(A1); free(A2);
free(B1); free(B2);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -199,7 +199,10 @@ int testing_zpotri(int argc, char **argv) ...@@ -199,7 +199,10 @@ int testing_zpotri(int argc, char **argv)
MORSE_Complex64_t *WORK = (MORSE_Complex64_t *)malloc(2*LDA*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *WORK = (MORSE_Complex64_t *)malloc(2*LDA*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ((!A1)||(!A2)){ if ( (!A1) || (!A2) || (!work) )
{
free(A1); free(A2);
free(work);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -81,7 +81,10 @@ int testing_zsymm(int argc, char **argv) ...@@ -81,7 +81,10 @@ int testing_zsymm(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){ if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) )
{
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -82,7 +82,10 @@ int testing_zsyr2k(int argc, char **argv) ...@@ -82,7 +82,10 @@ int testing_zsyr2k(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) ){ if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) )
{
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -77,7 +77,9 @@ int testing_zsyrk(int argc, char **argv) ...@@ -77,7 +77,9 @@ int testing_zsyrk(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A) || (!Cinit) || (!Cfinal) ){ if ( (!A) || (!C) || (!Cinit) || (!Cfinal) ){
free(A); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -77,7 +77,10 @@ int testing_ztrmm(int argc, char **argv) ...@@ -77,7 +77,10 @@ int testing_ztrmm(int argc, char **argv)
MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Binit) || (!Bfinal)){ if ( (!A) || (!B) || (!Binit) || (!Bfinal) )
{
free(A); free(B);
free(Binit); free(Bfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
...@@ -77,7 +77,10 @@ int testing_ztrsm(int argc, char **argv) ...@@ -77,7 +77,10 @@ int testing_ztrsm(int argc, char **argv)
MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t)); MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */ /* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Binit) || (!Bfinal)){ if ( (!A) || (!B) || (!Binit) || (!Bfinal) )
{
free(A); free(B);
free(Binit); free(Bfinal);
printf("Out of Memory \n "); printf("Out of Memory \n ");
return -2; return -2;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment