1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

Don't reuse possibly free()d memory.

Found by:	phkmalloc
This commit is contained in:
Thomas Gellekum 2001-03-08 12:44:05 +00:00
parent 1080c89c3d
commit 8526c067cc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=39255

View File

@ -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);