Changeset ec506d49 in mainline


Ignore:
Timestamp:
2020-04-17T12:17:26Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
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.