diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
commit | 02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch) | |
tree | f053238978479e408a2b83571443e132f30586ab /src/libmach/crack.c | |
parent | c0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff) | |
parent | 3d1382b98a502d0c34d5ba2c462396acc515016e (diff) | |
download | plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2 plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/libmach/crack.c')
-rw-r--r-- | src/libmach/crack.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libmach/crack.c b/src/libmach/crack.c index 6d167404..a2106f05 100644 --- a/src/libmach/crack.c +++ b/src/libmach/crack.c @@ -10,7 +10,7 @@ Mach *mach; extern Mach mach386; extern Mach machpower; -static Mach *machs[] = +static Mach *machs[] = { &mach386, &machpower, @@ -69,6 +69,7 @@ crackhdr(char *name, int mode) return hdr; } werrstr("unknown file type: %r"); + free(hdr->filename); free(hdr); close(fd); return nil; @@ -89,6 +90,7 @@ uncrackhdr(Fhdr *hdr) for(i=0; i<hdr->nthread; i++) free(hdr->thread[i].ureg); free(hdr->thread); + free(hdr->filename); free(hdr); } @@ -123,7 +125,7 @@ unmapfile(Fhdr *fp, Map *map) for(i=0; i<map->nseg; i++){ while(i<map->nseg && map->seg[i].fd == fp->fd){ map->nseg--; - memmove(&map->seg[i], &map->seg[i+1], + memmove(&map->seg[i], &map->seg[i+1], (map->nseg-i)*sizeof(map->seg[0])); } } @@ -147,4 +149,3 @@ coreregs(Fhdr *fp, uint id) werrstr("thread not found"); return nil; } - |