[gtk/wip/otte/for-main: 1/3] roaring: Remove extra careful code




commit ea79f2dcf4b867de912d67a30524b3e8501a1333
Author: Benjamin Otte <otte redhat com>
Date:   Tue Apr 26 19:38:36 2022 +0200

    roaring: Remove extra careful code
    
    because gcc knows it's too careful

 gtk/roaring/roaring.c | 4 ----
 1 file changed, 4 deletions(-)
---
diff --git a/gtk/roaring/roaring.c b/gtk/roaring/roaring.c
index 84a89e3fea..17eec65ca8 100644
--- a/gtk/roaring/roaring.c
+++ b/gtk/roaring/roaring.c
@@ -2979,7 +2979,6 @@ int array_container_shrink_to_fit(array_container_t *src) {
       uint16_t *oldarray = src->array;
       src->array =
         (uint16_t *)realloc(oldarray, src->capacity * sizeof(uint16_t));
-      if (src->array == NULL) free(oldarray);  // should never happen?
     }
     return savings;
 }
@@ -3016,7 +3015,6 @@ void array_container_grow(array_container_t *container, int32_t min,
     if (preserve) {
         container->array =
             (uint16_t *)realloc(array, new_capacity * sizeof(uint16_t));
-        if (container->array == NULL) free(array);
     } else {
         // Jon Strabala reports that some tools complain otherwise
         if (array != NULL) {
@@ -6691,7 +6689,6 @@ int run_container_shrink_to_fit(run_container_t *src) {
     src->capacity = src->n_runs;
     rle16_t *oldruns = src->runs;
     src->runs = (rle16_t *)realloc(oldruns, src->capacity * sizeof(rle16_t));
-    if (src->runs == NULL) free(oldruns);  // should never happen?
     return savings;
 }
 /* Create a new run container. Return NULL in case of failure. */
@@ -6731,7 +6728,6 @@ void run_container_grow(run_container_t *run, int32_t min, bool copy) {
         rle16_t *oldruns = run->runs;
         run->runs =
             (rle16_t *)realloc(oldruns, run->capacity * sizeof(rle16_t));
-        if (run->runs == NULL) free(oldruns);
     } else {
         // Jon Strabala reports that some tools complain otherwise
         if (run->runs != NULL) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]