From: Matthew Fernandez Date: Sat, 26 Jun 2021 23:19:44 +0000 (-0700) Subject: remove unnecessary not-null guards to free in Operator_diag_precon_delete X-Git-Tag: 2.49.0~63^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4fb32ac18c703c1aa36e344f9261c9e5ae165cd4;p=graphviz remove unnecessary not-null guards to free in Operator_diag_precon_delete It is well-defined to free null. Apart from this though, the first condition containing a dereference of `o` implies that `o` is not null so the second condition can be assumed true. --- diff --git a/lib/sfdpgen/sparse_solve.c b/lib/sfdpgen/sparse_solve.c index 49bcd21d4..e68e8db17 100644 --- a/lib/sfdpgen/sparse_solve.c +++ b/lib/sfdpgen/sparse_solve.c @@ -147,8 +147,8 @@ static Operator Operator_diag_precon_new(SparseMatrix A){ } static void Operator_diag_precon_delete(Operator o){ - if (o->data) FREE(o->data); - if (o) FREE(o); + FREE(o->data); + FREE(o); } static real conjugate_gradient(Operator A, Operator precon, int n, real *x, real *rhs, real tol, int maxit){