From 2d56b7e6a2af89347a9b5e2190af574403c331a4 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 9 Jul 2025 23:26:12 +0200 Subject: [PATCH] Allocate IWORK to hold at least the one element for workspace queries --- LAPACKE/src/lapacke_dtrsen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LAPACKE/src/lapacke_dtrsen.c b/LAPACKE/src/lapacke_dtrsen.c index e045440ed..9daf02301 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 ) {