summaryrefslogtreecommitdiff
path: root/os2/os2.c
diff options
context:
space:
mode:
Diffstat (limited to 'os2/os2.c')
-rw-r--r--os2/os2.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/os2/os2.c b/os2/os2.c
index 3103012df2..7f011f7fea 100644
--- a/os2/os2.c
+++ b/os2/os2.c
@@ -1240,10 +1240,12 @@ settmppath()
if (!p) return;
len = strlen(p);
tpath = (char *)malloc(len + strlen(TMPPATH1) + 2);
- strcpy(tpath, p);
- tpath[len] = '/';
- strcpy(tpath + len + 1, TMPPATH1);
- tmppath = tpath;
+ if (tpath) {
+ strcpy(tpath, p);
+ tpath[len] = '/';
+ strcpy(tpath + len + 1, TMPPATH1);
+ tmppath = tpath;
+ }
}
#include "XSUB.h"