fix for misc errors

- reference to out of scope stack var
- freeing fixes size array (never allocated)
- add matching va_end for va_start
This commit is contained in:
Campbell Barton 2013-07-13 05:46:48 +00:00
parent 8a40444d6b
commit eedd541929
3 changed files with 2 additions and 4 deletions

@ -349,9 +349,6 @@ static void free_dynamic_typeinfo(bNodeType *ntype)
if (ntype->outputs) { if (ntype->outputs) {
MEM_freeN(ntype->outputs); MEM_freeN(ntype->outputs);
} }
if (ntype->ui_name) {
MEM_freeN((void *)ntype->ui_name);
}
} }
} }

@ -4142,6 +4142,7 @@ void uiButGetStrInfo(bContext *C, uiBut *but, ...)
si->strinfo = tmp; si->strinfo = tmp;
} }
va_end(args);
if (free_items && items) if (free_items && items)
MEM_freeN(items); MEM_freeN(items);

@ -265,6 +265,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], fl
bool *enter_editmode, unsigned int *layer, bool *is_view_aligned) bool *enter_editmode, unsigned int *layer, bool *is_view_aligned)
{ {
View3D *v3d = CTX_wm_view3d(C); View3D *v3d = CTX_wm_view3d(C);
unsigned int _layer;
/* Switch to Edit mode? */ /* Switch to Edit mode? */
if (RNA_struct_find_property(op->ptr, "enter_editmode")) { /* optional */ if (RNA_struct_find_property(op->ptr, "enter_editmode")) { /* optional */
@ -283,7 +284,6 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], fl
/* Get layers! */ /* Get layers! */
{ {
int a, layer_values[20]; int a, layer_values[20];
unsigned int _layer;
if (!layer) if (!layer)
layer = &_layer; layer = &_layer;