From bc97d7832906318a1185b3fb460b1d8d89020ba0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Aug 2021 13:59:38 +1000 Subject: Cleanup: use MEM_SAFE_FREE macro --- source/blender/editors/curve/editcurve.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/curve/editcurve.c') diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index e7d97ce343c..c399abfa52d 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1848,10 +1848,7 @@ static void ed_surf_delete_selected(Object *obedit) nu->pntsv = 1; SWAP(short, nu->orderu, nu->orderv); BKE_nurb_order_clamp_u(nu); - if (nu->knotsv) { - MEM_freeN(nu->knotsv); - } - nu->knotsv = NULL; + MEM_SAFE_FREE(nu->knotsv); } else { nu->pntsu = newu; @@ -4650,10 +4647,7 @@ static int make_segment_exec(bContext *C, wmOperator *op) /* now join the knots */ if (nu1->type == CU_NURBS) { - if (nu1->knotsu != NULL) { - MEM_freeN(nu1->knotsu); - nu1->knotsu = NULL; - } + MEM_SAFE_FREE(nu1->knotsu); BKE_nurb_knot_calc_u(nu1); } -- cgit v1.2.3