Changeset 265be8a in mainline


Ignore:
Timestamp:
2020-06-10T12:52:43Z (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:
94e75cf
Parents:
dc69b5c
git-author:
Manuele Conti <manuele.conti@…> (2020-06-10 08:17:09)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2020-06-10 12:52:43)
Message:

Avoid memory leak when realloc fails in vol_get_ids_internal function

File:
1 edited

Legend:

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

    rdc69b5c r265be8a  
    168168
    169169                alloc_size = act_size;
    170                 ids = realloc(ids, alloc_size);
    171                 if (ids == NULL)
     170                service_id_t *temp = realloc(ids, alloc_size);
     171                if (temp == NULL) {
     172                        free(ids);
    172173                        return ENOMEM;
     174                }
     175                ids = temp;
    173176        }
    174177
Note: See TracChangeset for help on using the changeset viewer.