From fc35590c6dddf32e1fa855b541dc28a23965f90c Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 23 May 1997 14:48:05 +0000 Subject: Import a slightly newer version of 1.9.9 (as at 970523) that has fixed a few more memory leaks and cleaned up getopt usage. These were done shortly after the last one I imported. Very little has changed other than that. (except for some doc updates) Obtained from: cyclic.com --- contrib/cvs/src/parseinfo.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'contrib/cvs/src/parseinfo.c') diff --git a/contrib/cvs/src/parseinfo.c b/contrib/cvs/src/parseinfo.c index 1011965..833463a 100644 --- a/contrib/cvs/src/parseinfo.c +++ b/contrib/cvs/src/parseinfo.c @@ -54,6 +54,7 @@ Parse_Info (infofile, repository, callproc, all) /* If no file, don't do anything special. */ if (!existence_error (errno)) error (0, errno, "cannot open %s", infopath); + free (infopath); return 0; } @@ -105,6 +106,8 @@ Parse_Info (infofile, repository, callproc, all) if ((cp = strrchr (value, '\n')) != NULL) *cp = '\0'; + if (expanded_value != NULL) + free (expanded_value); expanded_value = expand_path (value, infofile, line_number); if (!expanded_value) { @@ -121,6 +124,10 @@ Parse_Info (infofile, repository, callproc, all) /* save the default value so we have it later if we need it */ if (strcmp (exp, "DEFAULT") == 0) { + /* Is it OK to silently ignore all but the last DEFAULT + expression? */ + if (default_value != NULL) + free (default_value); default_value = xstrdup (expanded_value); continue; } -- cgit v1.1