Changeset a43febeb in mainline


Ignore:
Timestamp:
2020-04-28T14:58:05Z (4 years ago)
Author:
Manuele Conti <manuele.conti@…>
Parents:
2a09dcb
git-author:
Manuele Conti <manuele.conti@…> (2020-04-28 12:18:24)
git-committer:
Manuele Conti <manuele.conti@…> (2020-04-28 14:58:05)
Message:

Avoid memory leak in vdb_get_ids_internal on realloc fails

File:
1 edited

Legend:

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

    r2a09dcb ra43febeb  
    231231
    232232                alloc_size = act_size;
    233                 ids = realloc(ids, alloc_size);
    234                 if (ids == NULL)
     233                service_id_t *tmp = realloc(ids, alloc_size);
     234                if (tmp == NULL) {
     235                        free(ids);
    235236                        return ENOMEM;
     237                }
     238                ids = tmp;
    236239        }
    237240
Note: See TracChangeset for help on using the changeset viewer.