Changeset b742f8a in mainline


Ignore:
Timestamp:
2020-04-08T22:38:05Z (5 years ago)
Author:
Manuele Conti <manuele.conti@…>
Parents:
823461d3
Message:

Avoid memory leak on realloc into inetcfg_get_ids_internal procedure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/inetcfg.c

    r823461d3 rb742f8a  
    103103
    104104                alloc_size = act_size;
    105                 ids = realloc(ids, alloc_size);
    106                 if (ids == NULL)
     105                service_id_t *tmp = realloc(ids, alloc_size);
     106                if (tmp == NULL) {
     107                        free(ids);
    107108                        return ENOMEM;
     109                }
     110                ids = tmp;
    108111        }
    109112
Note: See TracChangeset for help on using the changeset viewer.