diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-18 19:23:40 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-18 19:23:40 +0400 |
commit | d2b0954b2ad2b2fd52198d75e839071a108ac69c (patch) | |
tree | 883c6362402db68ed0589e1aabaead2a4d4f3f14 /source | |
parent | a6fe2f1e189712b95bd57892828c4e5ce043a517 (diff) |
UI: fix access of freed memory in buttons handling code.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 4 |
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); |