1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-02 08:42:48 +00:00

Fixed two bugs: some malloced space wasn't freed after it was no longer

needed and the file wasn't closed when the -t option was used.
Originally by thomas@mathematik.uni-Bremen.de, but were incomplete.

Submitted by:	thomas@mathematik.uni-Bremen.de and myself
This commit is contained in:
David Greenman 1995-01-09 05:59:04 +00:00
parent cfc22f9026
commit 96bccfd8b2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5448
2 changed files with 8 additions and 2 deletions

View File

@ -220,7 +220,7 @@ bad1: (void)lseek(rfd, r_off, SEEK_SET);
static void
symobj()
{
register RLIB *rp;
register RLIB *rp, *rpnext;
struct ranlib rn;
off_t ransize;
long size, stroff;
@ -272,9 +272,14 @@ symobj()
error(tname);
/* Write out the string table. */
for (rp = rhead; rp; rp = rp->next)
for (rp = rhead; rp; rp = rpnext) {
if (!fwrite(rp->sym, rp->symlen, 1, fp))
error(tname);
rpnext = rp->next;
free(rp->sym);
free(rp);
}
rhead = NULL;
if (pad && !fwrite(&pad, sizeof(pad), 1, fp))
error(tname);

View File

@ -65,6 +65,7 @@ touch()
return(1);
}
settime(afd);
close_archive(afd);
return(0);
}