Fix for crash bug in SPQRSupport: Initialize pointers to nullptr to avoid free() calls of invalid pointers.

(cherry picked from commit 550af3938cc46116435f3dd88a9cdc94837d7542)
This commit is contained in:
Martin Heistermann 2022-02-18 16:13:28 +00:00 committed by Antonio Sanchez
parent 21e0ad056e
commit d1ed3fe5c9

View File

@ -258,12 +258,12 @@ class SPQR : public SparseSolverBase<SPQR<_MatrixType> >
int m_ordering; // Ordering method to use, see SPQR's manual int m_ordering; // Ordering method to use, see SPQR's manual
int m_allow_tol; // Allow to use some tolerance during numerical factorization. int m_allow_tol; // Allow to use some tolerance during numerical factorization.
RealScalar m_tolerance; // treat columns with 2-norm below this tolerance as zero RealScalar m_tolerance; // treat columns with 2-norm below this tolerance as zero
mutable cholmod_sparse *m_cR; // The sparse R factor in cholmod format mutable cholmod_sparse *m_cR = nullptr; // The sparse R factor in cholmod format
mutable MatrixType m_R; // The sparse matrix R in Eigen format mutable MatrixType m_R; // The sparse matrix R in Eigen format
mutable StorageIndex *m_E; // The permutation applied to columns mutable StorageIndex *m_E = nullptr; // The permutation applied to columns
mutable cholmod_sparse *m_H; //The householder vectors mutable cholmod_sparse *m_H = nullptr; //The householder vectors
mutable StorageIndex *m_HPinv; // The row permutation of H mutable StorageIndex *m_HPinv = nullptr; // The row permutation of H
mutable cholmod_dense *m_HTau; // The Householder coefficients mutable cholmod_dense *m_HTau = nullptr; // The Householder coefficients
mutable Index m_rank; // The rank of the matrix mutable Index m_rank; // The rank of the matrix
mutable cholmod_common m_cc; // Workspace and parameters mutable cholmod_common m_cc; // Workspace and parameters
bool m_useDefaultThreshold; // Use default threshold bool m_useDefaultThreshold; // Use default threshold