diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-05-27 00:36:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-27 00:36:42 +0200 |
commit | b0baf043e64ca4d6cf80f371c23ec8581ecd5d59 (patch) | |
tree | 5a4c3915b4ce4266a0104cdad29d236bbd6534f8 | |
parent | 11d5f8840002c29097fee78b300e1da986028721 (diff) | |
parent | b934ce815ff2d233a63d3edae2ba80ef4c271243 (diff) |
Merge pull request #152 from Ansuel/fix-memory-leak
program: fix memory leak in read_sourceinfo
-rw-r--r-- | program.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -587,8 +587,11 @@ read_sourceinfo(uc_source_t *input, uint32_t flags, char **errp, uc_program_t *p return NULL; } - if (!read_size_t(input->fp, &len, sizeof(uint32_t), "sourceinfo code buffer length", errp)) + if (!read_size_t(input->fp, &len, sizeof(uint32_t), "sourceinfo code buffer length", errp)) { + free(path); + return NULL; + } if (len > 0) { code = xalloc(len); |