summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-03-02 16:45:48 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-03-02 16:45:48 (GMT)
commitaba1c1aa3b4ab16e4366c830da27b3b085c3a74e (patch)
treefc1d79151319cf7b2bf4f19ac89fd76281cdb907
parent4a97a2b913c38b54394cce30b8771520c5d60a81 (diff)
parent0d2f5c8d6a3384816310aec2478cf9e3877e8569 (diff)
downloadCMake-aba1c1aa3b4ab16e4366c830da27b3b085c3a74e.zip
CMake-aba1c1aa3b4ab16e4366c830da27b3b085c3a74e.tar.gz
CMake-aba1c1aa3b4ab16e4366c830da27b3b085c3a74e.tar.bz2
Merge topic 'fix-macos-findprogramm-crash'
0d2f5c8 Fix crash if app bundle executeable couldn't be found
-rw-r--r--Source/cmFindProgramCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index 7c56ad7..00f5419 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -175,6 +175,8 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
// And finally to a c++ string
executable = bundlePath + "/Contents/MacOS/" + std::string(buffer);
+ // Only release CFURLRef if it's not null
+ CFRelease( executableURL );
}
// Any CF objects returned from functions with "create" or
@@ -182,7 +184,6 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
CFRelease( bundlePathCFS );
CFRelease( bundleURL );
CFRelease( appBundle );
- CFRelease( executableURL );
#endif
return executable;