Jacek Caban : mshtml: Improved handling empty dispex_data_t in preprocess_dispex_data.
Alexandre Julliard
julliard at winehq.org
Fri Jul 29 12:37:03 CDT 2011
Module: wine
Branch: master
Commit: 8cbc34e40fc3ae6d65f3ced298cbe509eaaa5210
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8cbc34e40fc3ae6d65f3ced298cbe509eaaa5210
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Jul 29 14:31:22 2011 +0200
mshtml: Improved handling empty dispex_data_t in preprocess_dispex_data.
---
dlls/mshtml/dispex.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index 09de654..98f73b6 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -248,21 +248,19 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
if(!data->func_cnt) {
heap_free(data->funcs);
+ data->name_table = NULL;
data->funcs = NULL;
- }else if(data->func_cnt != size) {
- data->funcs = heap_realloc(data->funcs, data->func_cnt * sizeof(func_info_t));
+ return data;
}
+
+ data->funcs = heap_realloc(data->funcs, data->func_cnt * sizeof(func_info_t));
qsort(data->funcs, data->func_cnt, sizeof(func_info_t), dispid_cmp);
- if(data->funcs) {
- data->name_table = heap_alloc(data->func_cnt * sizeof(func_info_t*));
- for(i=0; i < data->func_cnt; i++)
- data->name_table[i] = data->funcs+i;
- qsort(data->name_table, data->func_cnt, sizeof(func_info_t*), func_name_cmp);
- }else {
- data->name_table = NULL;
- }
+ data->name_table = heap_alloc(data->func_cnt * sizeof(func_info_t*));
+ for(i=0; i < data->func_cnt; i++)
+ data->name_table[i] = data->funcs+i;
+ qsort(data->name_table, data->func_cnt, sizeof(func_info_t*), func_name_cmp);
return data;
}
More information about the wine-cvs
mailing list