In the function: TRI_LocateBinaryPath(), "binaryPath" was duplicated from "dir" and then "dir" freed. Better just to assign to "binaryPath" the result of TRI_Dirname().