diff options
author | kaiw <kaiw@FreeBSD.org> | 2010-07-21 12:30:58 +0000 |
---|---|---|
committer | kaiw <kaiw@FreeBSD.org> | 2010-07-21 12:30:58 +0000 |
commit | bc05b1ebb0eae73c00f539ec402e421a51c05ac1 (patch) | |
tree | 9931c2546ff8ac7962c7e5e58c007cd32edcc6aa /lib | |
parent | f7b270cbd039ea679033565e586fe97d228eee38 (diff) | |
download | FreeBSD-src-bc05b1ebb0eae73c00f539ec402e421a51c05ac1.zip FreeBSD-src-bc05b1ebb0eae73c00f539ec402e421a51c05ac1.tar.gz |
Fix a memory leak.
Obtained from: elftoolchain
MFC after: 1 month
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libelf/elf_update.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libelf/elf_update.c b/lib/libelf/elf_update.c index 2d7681f..69bbaac 100644 --- a/lib/libelf/elf_update.c +++ b/lib/libelf/elf_update.c @@ -855,11 +855,13 @@ _libelf_write_elf(Elf *e, off_t newsize) e->e_u.e_elf.e_phdr.e_phdr64 = NULL; } + free(newfile); + return (rc); error: - if (newfile) - free(newfile); + free(newfile); + return ((off_t) -1); } |