Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-05-18 19:23:40 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-05-18 19:23:40 +0400
commitd2b0954b2ad2b2fd52198d75e839071a108ac69c (patch)
tree883c6362402db68ed0589e1aabaead2a4d4f3f14
parenta6fe2f1e189712b95bd57892828c4e5ce043a517 (diff)
UI: fix access of freed memory in buttons handling code.
-rw-r--r--source/blender/editors/interface/interface_handlers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index e2910d33b12..759301cc8f3 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -298,7 +298,7 @@ static void ui_apply_but_func(bContext *C, uiBut *but)
after->func_arg3= but->func_arg3;
after->funcN= but->funcN;
- after->func_argN= but->func_argN;
+ after->func_argN= MEM_dupallocN(but->func_argN);
after->rename_func= but->rename_func;
after->rename_arg1= but->rename_arg1;
@@ -402,6 +402,8 @@ static void ui_apply_but_funcs_after(bContext *C)
after.func(C, after.func_arg1, after.func_arg2);
if(after.funcN)
after.funcN(C, after.func_argN, after.func_arg2);
+ if(after.func_argN)
+ MEM_freeN(after.func_argN);
if(after.handle_func)
after.handle_func(C, after.handle_func_arg, after.retval);