Skip to content

Commit b746f0e

Browse files
authored
Allocate IWORK to hold at least the one element for workspace queries
1 parent b8f66ba commit b746f0e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lapack-netlib/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 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 ) {

lapack-netlib/LAPACKE/src/lapacke_strsen.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,14 @@ lapack_int LAPACKE_strsen( int matrix_layout, char job, char compq,
7777
info = LAPACK_WORK_MEMORY_ERROR;
7878
goto exit_level_0;
7979
}
80+
} else {
81+
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) );
82+
if( iwork == NULL ) {
83+
info = LAPACK_WORK_MEMORY_ERROR;
84+
goto exit_level_0;
85+
}
8086
}
87+
8188
work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
8289
if( work == NULL ) {
8390
info = LAPACK_WORK_MEMORY_ERROR;

0 commit comments

Comments
 (0)