Skip to content

Commit 2d56b7e

Browse files
authored
Allocate IWORK to hold at least the one element for workspace queries
1 parent ecbbecd commit 2d56b7e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

LAPACKE/src/lapacke_dtrsen.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ lapack_int API_SUFFIX(LAPACKE_dtrsen)( int matrix_layout, char job, char compq,
7878
info = LAPACK_WORK_MEMORY_ERROR;
7979
goto exit_level_0;
8080
}
81+
} else {
82+
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) );
83+
if( iwork == NULL ) {
84+
info = LAPACK_WORK_MEMORY_ERROR;
85+
goto exit_level_0;
86+
}
8187
}
8288
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
8389
if( work == NULL ) {

0 commit comments

Comments
 (0)