Changeset 18c2e87 in mainline


Ignore:
Timestamp:
2020-04-29T20:47:07Z (4 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:
7d3a4ac
Parents:
f7f2c7f
git-author:
Manuele Conti <manuele.conti@…> (2020-04-29 19:20:50)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2020-04-29 20:47:07)
Message:

Avoid memory leak in range_get_str function on reallloc fails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/edit/edit.c

    rf7f2c7f r18c2e87  
    791791
    792792                buf_size *= 2;
    793                 buf = realloc(buf, buf_size);
    794                 if (buf == NULL)
     793                char *tmp = realloc(buf, buf_size);
     794                if (tmp == NULL) {
     795                        free(buf);
    795796                        return NULL;
     797                }
     798                buf = tmp;
    796799        }
    797800
Note: See TracChangeset for help on using the changeset viewer.