aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/gcore
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2007-04-10 17:37:53 +0000
committerEd Maste <emaste@FreeBSD.org>2007-04-10 17:37:53 +0000
commitaffde8a968fe533061fe4bedb4701307d76cd70d (patch)
treed71ef8be4082f2a1d858041da587da913d3be528 /usr.bin/gcore
parent57bcf75fd24f5f7900ece69dce713d59a9febaff (diff)
downloadsrc-affde8a968fe533061fe4bedb4701307d76cd70d.tar.gz
src-affde8a968fe533061fe4bedb4701307d76cd70d.zip
Eliminate memory leak from an accidental malloc().
Notes
Notes: svn path=/head/; revision=168595
Diffstat (limited to 'usr.bin/gcore')
-rw-r--r--usr.bin/gcore/elfcore.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c
index 00b32862708f..2c27a64aba1d 100644
--- a/usr.bin/gcore/elfcore.c
+++ b/usr.bin/gcore/elfcore.c
@@ -130,7 +130,6 @@ elf_coredump(int efd __unused, int fd, pid_t pid)
* Allocate memory for building the header, fill it up,
* and write it out.
*/
- hdr = malloc(hdrsize);
if ((hdr = malloc(hdrsize)) == NULL)
errx(1, "out of memory");
elf_corehdr(fd, pid, map, seginfo.count, hdr, hdrsize);