diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-04 02:36:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-04 02:36:59 +0400 |
commit | 0c659da03bafb28c3c4b3752f6df2f6a446d025d (patch) | |
tree | 1ae95cab6a914c59377b500f3638ca8037e2347c /source/blender/editors/transform/transform_ops.c | |
parent | 81b8bdc353e8ae129b40a55d619ad59c4ee118e6 (diff) |
bugfix [#23158] Translate operator leaks memory if nothing selected
Diffstat (limited to 'source/blender/editors/transform/transform_ops.c')
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 29bcd4e8592..da454d1f03d 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -281,7 +281,7 @@ static int transformops_data(bContext *C, wmOperator *op, wmEvent *event) int retval = 1; if (op->customdata == NULL) { - TransInfo *t = MEM_callocN(sizeof(TransInfo), "TransInfo data"); + TransInfo *t = MEM_callocN(sizeof(TransInfo), "TransInfo data2"); TransformModeItem *tmode; int mode = -1; @@ -303,7 +303,12 @@ static int transformops_data(bContext *C, wmOperator *op, wmEvent *event) G.moving = 1; /* store data */ - op->customdata = t; + if(retval) { + op->customdata = t; + } + else { + MEM_freeN(t); + } } return retval; /* return 0 on error */ |