diff --git a/LAPACKE/src/lapacke_dtrsen.c b/LAPACKE/src/lapacke_dtrsen.c index e045440edb..9daf023014 100644 --- a/LAPACKE/src/lapacke_dtrsen.c +++ b/LAPACKE/src/lapacke_dtrsen.c @@ -78,6 +78,12 @@ lapack_int API_SUFFIX(LAPACKE_dtrsen)( int matrix_layout, char job, char compq, info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } + } else { + iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) ); + if( iwork == NULL ) { + info = LAPACK_WORK_MEMORY_ERROR; + goto exit_level_0; + } } work = (double*)LAPACKE_malloc( sizeof(double) * lwork ); if( work == NULL ) { diff --git a/LAPACKE/src/lapacke_strsen.c b/LAPACKE/src/lapacke_strsen.c index 547dd52df4..3813e3b281 100644 --- a/LAPACKE/src/lapacke_strsen.c +++ b/LAPACKE/src/lapacke_strsen.c @@ -77,6 +77,12 @@ lapack_int API_SUFFIX(LAPACKE_strsen)( int matrix_layout, char job, char compq, info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } + } else { + iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) ); + if( iwork == NULL ) { + info = LAPACK_WORK_MEMORY_ERROR; + goto exit_level_0; + } } work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) {