From: Vincent Pit Date: Tue, 30 Oct 2012 11:41:39 +0000 (-0200) Subject: Stop leaking the return value of NSGetExecutablePath() X-Git-Tag: v0.02~5 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FMac-NSGetExecutablePath.git;a=commitdiff_plain;h=180647c780dba17e20b7fe68103d8032f37c697e Stop leaking the return value of NSGetExecutablePath() --- diff --git a/NSGetExecutablePath.xs b/NSGetExecutablePath.xs index c0a3a93..93ba9a3 100644 --- a/NSGetExecutablePath.xs +++ b/NSGetExecutablePath.xs @@ -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);