Commit 8cbc34e4 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Improved handling empty dispex_data_t in preprocess_dispex_data.

parent ce57ebe3
...@@ -248,21 +248,19 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This) ...@@ -248,21 +248,19 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
if(!data->func_cnt) { if(!data->func_cnt) {
heap_free(data->funcs); heap_free(data->funcs);
data->name_table = NULL;
data->funcs = NULL; data->funcs = NULL;
}else if(data->func_cnt != size) { return data;
data->funcs = heap_realloc(data->funcs, data->func_cnt * sizeof(func_info_t));
} }
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); 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*));
data->name_table = heap_alloc(data->func_cnt * sizeof(func_info_t*)); for(i=0; i < data->func_cnt; i++)
for(i=0; i < data->func_cnt; i++) data->name_table[i] = data->funcs+i;
data->name_table[i] = data->funcs+i; qsort(data->name_table, data->func_cnt, sizeof(func_info_t*), func_name_cmp);
qsort(data->name_table, data->func_cnt, sizeof(func_info_t*), func_name_cmp);
}else {
data->name_table = NULL;
}
return data; return data;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment