Skip to content

Commit 0210957

Browse files
committed
Fix use-after-free in osx_platform.cpp
1 parent aba885c commit 0210957

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/src/osx_platform.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ bool OSXPlatform::run_privileged()
3939
OSStatus err;
4040
AuthorizationFlags flags;
4141

42-
const char *path = this->path().c_str();
42+
const string &path = this->path();
4343

4444
flags = kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed;
4545

@@ -49,7 +49,7 @@ bool OSXPlatform::run_privileged()
4949

5050
char *args[] = { (char *) "--fix-permissions", NULL };
5151

52-
err = AuthorizationExecuteWithPrivileges(auth, path, kAuthorizationFlagDefaults, args, NULL);
52+
err = AuthorizationExecuteWithPrivileges(auth, path.c_str(), kAuthorizationFlagDefaults, args, NULL);
5353
AuthorizationFree(auth, kAuthorizationFlagDefaults);
5454
if (err == errAuthorizationCanceled)
5555
return false;

0 commit comments

Comments
 (0)