From cc5c4110396cc92eef0161b398d5658cd86d682a Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 24 Dec 2012 12:25:04 +0000 Subject: [PATCH] Remove leftover use of str2wcs. --- wutil.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wutil.cpp b/wutil.cpp index 5984747ad..978b7e0a8 100644 --- a/wutil.cpp +++ b/wutil.cpp @@ -333,14 +333,13 @@ wchar_t *wrealpath(const wcstring &pathname, wchar_t *resolved_path) if (resolved_path) { - wchar_t *tmp2 = str2wcs(narrow_res); - wcslcpy(resolved_path, tmp2, PATH_MAX); - free(tmp2); + wcstring tmp2 = str2wcstring(narrow_res); + wcslcpy(resolved_path, tmp2.c_str(), PATH_MAX); res = resolved_path; } else { - res = str2wcs(narrow_res); + res = wcsdup(str2wcstring(narrow_res).c_str()); } return res; }