summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-01-15 16:15:22 +0000
committerKarl Berry <karl@freefriends.org>2008-01-15 16:15:22 +0000
commit866ffb1ed5b357aae044468790e53f80d7b977fa (patch)
treed9551d07e4dd2ed9aca876203c9f843a196fbcc4 /Build/source
parenta3df5e2244a4c54e160882c400f2ea6a30f280eb (diff)
only free if new memory
git-svn-id: svn://tug.org/texlive/trunk@6239 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog4
-rw-r--r--Build/source/texk/kpathsea/cnf.c10
-rw-r--r--Build/source/texk/kpathsea/variable.c7
3 files changed, 13 insertions, 8 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 97d4136d09e..866c8a1b7bf 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-15 Karl Berry <karl@tug.org>
+
+ * variable.c (kpse_var_value): only free if new memory.
+
2008-01-14 Karl Berry <karl@tug.org>
* variable.c (kpse_var_value): also do ~ expansion.
diff --git a/Build/source/texk/kpathsea/cnf.c b/Build/source/texk/kpathsea/cnf.c
index 12a0b574828..8f28e0facf9 100644
--- a/Build/source/texk/kpathsea/cnf.c
+++ b/Build/source/texk/kpathsea/cnf.c
@@ -1,7 +1,7 @@
/* cnf.c: read config files.
+ Copyright 1994, 1995, 1996, 1997, 2008 Karl Berry.
Copyright 1997-2005 Olaf Weber.
- Copyright 1994, 95, 96, 97 Karl Berry.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -13,11 +13,8 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-*/
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, see <http://www.gnu.org/licenses/>. */
#include <kpathsea/config.h>
#include <kpathsea/c-fopen.h>
@@ -251,5 +248,4 @@ kpse_cnf_get P1C(const_string, name)
}
return ret;
-
}
diff --git a/Build/source/texk/kpathsea/variable.c b/Build/source/texk/kpathsea/variable.c
index 2e581f1bf9f..7632f576c70 100644
--- a/Build/source/texk/kpathsea/variable.c
+++ b/Build/source/texk/kpathsea/variable.c
@@ -61,8 +61,13 @@ kpse_var_value P1C(const_string, var)
worry about doing the ~ expansion. */
if (ret) {
string tmp = kpse_var_expand (ret);
+ if (tmp != ret) {
+ free (ret);
+ }
ret = kpse_tilde_expand (tmp);
- free (tmp);
+ if (ret != tmp) {
+ free (tmp);
+ }
}
#ifdef KPSE_DEBUG