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:
authorDaniel Genrich <daniel.genrich@gmx.net>2010-04-27 00:30:13 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2010-04-27 00:30:13 +0400
commit523b95898bc6ec94171eccee9f3a8801e10c233a (patch)
tree8bd780bc881f3a28048dfcacf01f7b4331704f08
parenta547e91d41c566f15d0aeb15841414f56723f6e5 (diff)
Add missing null check solving crash on texture panel, also fix possible 'freeing NULL' because of misplaced MEM_freeN() in that context.
-rw-r--r--source/blender/editors/interface/interface_layout.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 2ae1a549db9..762203272a3 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1105,9 +1105,11 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, ui
if(flag & PROP_ID_SELF_CHECK)
if(itemptr.data == but->rnapoin.id.data)
continue;
-
- if(RNA_struct_is_ID(itemptr.type))
+
+ if(itemptr.type && RNA_struct_is_ID(itemptr.type))
iconid= ui_id_icon_get((bContext*)C, itemptr.data, 0);
+ else
+ iconid = 0;
name= RNA_struct_name_get_alloc(&itemptr, NULL, 0);
@@ -1119,8 +1121,8 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, ui
cis->iconid = iconid;
BLI_addtail(items_list, cis);
}
+ MEM_freeN(name);
}
- MEM_freeN(name);
i++;
}