[PATCH] mshtml: check for failed allocs (Coverity)

Marcus Meissner marcus at jet.franken.de
Sun Jan 11 16:40:19 CST 2015


CID 1262243
---
 dlls/mshtml/dispex.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index 7f6d5c5..a97f09d 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -345,9 +345,18 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
     }
 
     data = heap_alloc(sizeof(dispex_data_t));
+    if (!data) {
+        ERR("Out of memory\n");
+        return NULL;
+    }
     data->func_cnt = 0;
     data->func_disp_cnt = 0;
     data->funcs = heap_alloc_zero(size*sizeof(func_info_t));
+    if (!data->funcs) {
+        heap_free (data);
+        ERR("Out of memory\n");
+        return NULL;
+    }
     list_add_tail(&dispex_data_list, &data->entry);
 
     while(*tid) {
-- 
1.8.4.5




More information about the wine-patches mailing list