diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-23 19:26:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-23 19:26:06 +0400 |
commit | cccd4b72e5ca172035a87d24ca6809c828a5e49b (patch) | |
tree | 37b8c6876aaec1cddfe52df524f7f2f39c4fc93c /source/blender/editors | |
parent | eff325a98c0765ca9045766cbf790ecdffdf0451 (diff) |
fix memory leak in rip tool (again own fault).
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_rip.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 2380efc818b..caf44987f54 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -433,9 +433,13 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event) int vout_len; BM_vert_select_set(bm, v, FALSE); - bmesh_vert_separate(bm, v, &vout, &vout_len); - if (vout_len < 2) { + if (bmesh_vert_separate(bm, v, &vout, &vout_len) == FALSE) { + BKE_report(op->reports, RPT_ERROR, "Error ripping vertex from faces"); + return OPERATOR_CANCELLED; + } + else if (vout_len < 2) { + MEM_freeN(vout); /* set selection back to avoid active-unselected vertex */ BM_vert_select_set(bm, v, TRUE); /* should never happen */ |