UI: fix access of freed memory in buttons handling code.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user