aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>2001-03-08 20:44:05 +0800
committertg <tg@FreeBSD.org>2001-03-08 20:44:05 +0800
commit83ece6e6f03c15c28caf365e7e9d39605154c243 (patch)
tree044b1b8aa47ba1cac79ba127a0d3b96b24e95ba5
parent59dcfc46bc7bb98ac009f60e3a6c33a23d8499b7 (diff)
downloadfreebsd-ports-gnome-83ece6e6f03c15c28caf365e7e9d39605154c243.tar.gz
freebsd-ports-gnome-83ece6e6f03c15c28caf365e7e9d39605154c243.tar.zst
freebsd-ports-gnome-83ece6e6f03c15c28caf365e7e9d39605154c243.zip
Don't reuse possibly free()d memory.
Found by: phkmalloc
-rw-r--r--astro/xephem/files/patch-saveres.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/astro/xephem/files/patch-saveres.c b/astro/xephem/files/patch-saveres.c
new file mode 100644
index 000000000000..8f7616a6e909
--- /dev/null
+++ b/astro/xephem/files/patch-saveres.c
@@ -0,0 +1,20 @@
+--- saveres.c.orig Thu Nov 30 07:01:20 2000
++++ saveres.c Sat Dec 30 16:07:54 2000
+@@ -1026,6 +1026,7 @@
+ /* try mdovride else use default */
+ FILE *ofp = fopenh (mdovride, "r");
+ char *vp = NULL;
++ char *vph;
+ char nam[MRNAM], val[MRVAL], buf[MLL];
+
+ if (ofp) {
+@@ -1043,7 +1044,8 @@
+ }
+ if (!vp)
+ vp = mydirdef;
+- mydir = XtNewString (expand_home(vp));
++ vph = expand_home(vp);
++ mydir = XtNewString (vph);
+ if (access (mydir, X_OK) < 0 && mkdir (mydir, 0744) < 0) {
+ sprintf (buf, "%s: %s", mydir, syserrstr());
+ xe_msg (buf, 1);