summaryrefslogtreecommitdiff
path: root/contrib/cvs/src/fileattr.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2000-10-02 06:33:59 +0000
committerPeter Wemm <peter@FreeBSD.org>2000-10-02 06:33:59 +0000
commitd65e2e3fd6d2fae775587bc7e7fd82dae22de4ec (patch)
tree69361a1e7edad9b079647803c60eec4bbeeabe2f /contrib/cvs/src/fileattr.c
parent6adbf7beeb8444a3af05381ac20070a4922c27df (diff)
parenta3b502f88fd3d67bf547634d411d567524c4c1b1 (diff)
Notes
Diffstat (limited to 'contrib/cvs/src/fileattr.c')
-rw-r--r--contrib/cvs/src/fileattr.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/cvs/src/fileattr.c b/contrib/cvs/src/fileattr.c
index 4042d2a528e8..bae03a661d9d 100644
--- a/contrib/cvs/src/fileattr.c
+++ b/contrib/cvs/src/fileattr.c
@@ -126,7 +126,7 @@ fileattr_read ()
any line other than the first for that filename. This
is the way that CVS has behaved since file attributes
were first introduced. */
- free (newnode);
+ freenode (newnode);
}
else if (line[0] == 'D')
{
@@ -513,6 +513,7 @@ fileattr_write ()
FILE *fp;
char *fname;
mode_t omask;
+ struct unrecog *p;
if (!attrs_modified)
return;
@@ -616,17 +617,10 @@ fileattr_write ()
}
/* Then any other attributes. */
- while (unrecog_head != NULL)
+ for (p = unrecog_head; p != NULL; p = p->next)
{
- struct unrecog *p;
-
- p = unrecog_head;
fputs (p->line, fp);
fputs ("\012", fp);
-
- unrecog_head = p->next;
- free (p->line);
- free (p);
}
if (fclose (fp) < 0)
@@ -649,4 +643,11 @@ fileattr_free ()
if (fileattr_default_attrs != NULL)
free (fileattr_default_attrs);
fileattr_default_attrs = NULL;
+ while (unrecog_head)
+ {
+ struct unrecog *p = unrecog_head;
+ unrecog_head = p->next;
+ free (p->line);
+ free (p);
+ }
}