]> git.vpit.fr Git - perl/modules/Mac-NSGetExecutablePath.git/commitdiff
Stop leaking the return value of NSGetExecutablePath()
authorVincent Pit <vince@profvince.com>
Tue, 30 Oct 2012 11:41:39 +0000 (09:41 -0200)
committerVincent Pit <vince@profvince.com>
Tue, 30 Oct 2012 11:41:39 +0000 (09:41 -0200)
NSGetExecutablePath.xs

index c0a3a93bccce1e339aa4617a75fd5f2be1577e67..93ba9a301e11539cf01a67680bd70ac91e95881f 100644 (file)
@@ -29,12 +29,8 @@ PPCODE:
  _NSGetExecutablePath(buf, &size);
  if (size >= MAXPATHLEN * MAXPATHLEN)
   croak(nsgep_too_long);
-#ifdef newSV_type
- dst = newSV_type(SVt_PV);
-#else
- dst = sv_newmortal();
- (void) SvUPGRADE(dst, SVt_PV);
-#endif
+ dst    = sv_newmortal();
+ sv_upgrade(dst, SVt_PV);
  buffer = SvGROW(dst, size);
  if (_NSGetExecutablePath(buffer, &size))
   croak(nsgep_too_long);