Fixed bugs..Atomic2.java testcase works fine
[IRC.git] / Robust / src / Runtime / DSTM / interface / objstr.c
index 4a66fa54565f9e81d87e310c58395f4dd6aec7a6..08b3c5712ebf07e2e123be0717d6fec836f12b05 100644 (file)
@@ -38,12 +38,16 @@ void *objstrAlloc(objstr_t *store, unsigned int size)
                        if (size > DEFAULT_OBJ_STORE_SIZE) //in case of large objects
                        {
                                store->next = (objstr_t *)malloc(sizeof(objstr_t) + size);
+                               if (store->next == NULL)
+                                       return NULL;
                                store = store->next;
                                store->size = size;
                        }
                        else
                        {
                                store->next = malloc(sizeof(objstr_t) + DEFAULT_OBJ_STORE_SIZE);
+                               if (store->next == NULL)
+                                       return NULL;
                                store = store->next;
                                store->size = DEFAULT_OBJ_STORE_SIZE;
                        }