summaryrefslogtreecommitdiffstats
path: root/usr.bin/gcore
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2007-04-10 17:37:53 +0000
committeremaste <emaste@FreeBSD.org>2007-04-10 17:37:53 +0000
commit56a3d8cfd377ad7cce05adf21c9f9770dc74db12 (patch)
treed71ef8be4082f2a1d858041da587da913d3be528 /usr.bin/gcore
parentb159725895c2c6ab74dca42155e2a313c18b641a (diff)
downloadFreeBSD-src-56a3d8cfd377ad7cce05adf21c9f9770dc74db12.zip
FreeBSD-src-56a3d8cfd377ad7cce05adf21c9f9770dc74db12.tar.gz
Eliminate memory leak from an accidental malloc().
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 00b3286..2c27a64 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);
OpenPOWER on IntegriCloud