mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
elfctl: remove memory leak
CID: 1420356 Reported by: Coverity Scan Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
0fc06121ac
commit
b7a9e9d6b2
1 changed files with 2 additions and 0 deletions
|
|
@ -352,6 +352,7 @@ get_file_features(Elf *elf, int phcount, int fd, uint32_t *features,
|
|||
descsz = roundup2(note.n_descsz, 4);
|
||||
if (read(fd, name, namesz) < namesz) {
|
||||
warnx("elf note name too short");
|
||||
free(name);
|
||||
return (false);
|
||||
}
|
||||
read_total += namesz;
|
||||
|
|
@ -386,6 +387,7 @@ get_file_features(Elf *elf, int phcount, int fd, uint32_t *features,
|
|||
if (read(fd, features, sizeof(uint32_t)) <
|
||||
(ssize_t)sizeof(uint32_t)) {
|
||||
warnx("feature note data too short");
|
||||
free(name);
|
||||
return (false);
|
||||
}
|
||||
if (off != NULL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue