Don't derefence Matrix->SMPkluMatrix->KLUmatrixCommon if it is NULL.
Test for NULL moved upwards in front of dereferencing.
This commit is contained in:
parent
f541c6fb05
commit
0141473aa4
|
|
@ -535,6 +535,10 @@ SMPcLUfac (SMPmatrix *Matrix, double PivTol)
|
|||
|
||||
if (ret == 0)
|
||||
{
|
||||
if (Matrix->SMPkluMatrix->KLUmatrixCommon == NULL) {
|
||||
fprintf(stderr, "Error (ReFactor Complex): KLUcommon object is NULL. A problem occurred\n");
|
||||
return 0 ;
|
||||
}
|
||||
if (Matrix->SMPkluMatrix->KLUmatrixCommon->status == KLU_SINGULAR) {
|
||||
if (ft_ngdebug) {
|
||||
fprintf(stderr, "Warning (ReFactor Complex): KLU Matrix is SINGULAR\n");
|
||||
|
|
@ -543,9 +547,6 @@ SMPcLUfac (SMPmatrix *Matrix, double PivTol)
|
|||
}
|
||||
return E_SINGULAR ;
|
||||
}
|
||||
if (Matrix->SMPkluMatrix->KLUmatrixCommon == NULL) {
|
||||
fprintf (stderr, "Error (ReFactor Complex): KLUcommon object is NULL. A problem occurred\n") ;
|
||||
}
|
||||
if (Matrix->SMPkluMatrix->KLUmatrixCommon->status == KLU_EMPTY_MATRIX)
|
||||
{
|
||||
fprintf (stderr, "Error (ReFactor Complex): KLU Matrix is empty\n") ;
|
||||
|
|
|
|||
Loading…
Reference in New Issue