]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - frsh_api/frsh_spare_capacity.c
Remove "Setup" header from tests
[frescor/frsh.git] / frsh_api / frsh_spare_capacity.c
index 5806c7c3b0bf018d70395eda5e29ee6b40b42ddd..fb3efff088cffe4a12c37194d49f53c0a58d209e 100644 (file)
@@ -103,7 +103,9 @@ int frsh_contract_set_reclamation_params
 
        if (utilization_set) {
                int i;
-               forb_sequence_alloc_buf(s->variants, utilization_set->size);
+               if (!forb_sequence_alloc_buf(&s->variants, utilization_set->size)) {
+                       goto err;
+               }
                for (i=0; i<utilization_set->size; i++) {
                        struct fres_container *c = NULL;
                        fres_block_basic *b = NULL;
@@ -136,7 +138,7 @@ int frsh_contract_set_reclamation_params
 
                        ret = fres_container_add_timing_reqs(c, t);
 
-                       forb_sequence_elem(s->variants, i) = c;
+                       forb_sequence_elem(&s->variants, i) = c;
                        continue;
                err_ut:
                        fres_container_destroy(c);
@@ -160,7 +162,7 @@ int frsh_contract_set_reclamation_params
 
        return FRSH_NO_ERROR;
 err:
-       forb_sequence_free_buf(s->variants, forb_no_destructor);
+       forb_sequence_free_buf(&s->variants, forb_no_destructor);
        free(s);
        return errno;
 }