Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset ec506d49 in mainline


Ignore:
Timestamp:
2020-04-17T12:17:26Z (5 weeks ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master
Children:
11e4856, a25b496, dd4b54d
Parents:
823461d3
git-author:
Manuele Conti <manuele.conti@…> (2020-04-08 22:38:05)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2020-04-17 12:17:26)
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 rec506d49  
    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.