summaryrefslogtreecommitdiff
path: root/ext/Cwd/Cwd.xs
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-07-22 16:16:41 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-07-22 16:16:41 +0000
commit275e8705031e539ec9999f68482039d1bcfb1608 (patch)
tree3adcf4102a62a22872695a978f67609cf6bfae85 /ext/Cwd/Cwd.xs
parent6d3b25aa06c9837fbb97c3791369b6d8990787c7 (diff)
downloadperl-275e8705031e539ec9999f68482039d1bcfb1608.tar.gz
Upgrade to Cwd 2.20
p4raw-id: //depot/perl@23152
Diffstat (limited to 'ext/Cwd/Cwd.xs')
-rw-r--r--ext/Cwd/Cwd.xs6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/Cwd/Cwd.xs b/ext/Cwd/Cwd.xs
index fae3ef97e3..273ab2d121 100644
--- a/ext/Cwd/Cwd.xs
+++ b/ext/Cwd/Cwd.xs
@@ -424,10 +424,10 @@ PPCODE:
else
croak("Usage: getdcwd(DRIVE)");
- /* Pass a NULL pointer as the second argument to have space allocated. */
- if (dir = _getdcwd(drive, NULL, MAXPATHLEN)) {
+ New(0,dir,MAXPATHLEN,char);
+ if (_getdcwd(drive, dir, MAXPATHLEN)) {
sv_setpvn(TARG, dir, strlen(dir));
- free(dir);
+ Safefree(dir);
SvPOK_only(TARG);
}
else