aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGarrett Brown <garbearucla@gmail.com>2013-06-27 12:45:15 -0700
committerGarrett Brown <garbearucla@gmail.com>2013-06-27 12:45:15 -0700
commit98a74f45f304f4aaf0fca51d2901a5d2fa086c5c (patch)
tree5b54967955ed0a87ac878a0969e2bd42b9d6debe /lib
parent64a0e617a012a0f5cba5c4c0d3723ac25477cf7a (diff)
Fix memory leak and a failed ASSERT under win32 Debug build. A string was being double-strdup'ed, causing delete[] to fail when deleting the copy from the different heap instead of the local one.
Tracking down the assert to dbgheap.c gives the following message: > a bad pointer has been passed in. It may be totally bogus, or it may have been allocated from another heap. The pointer MUST come from the 'local' heap.
Diffstat (limited to 'lib')
-rw-r--r--lib/addons/library.xbmc.addon/libXBMC_addon.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp
index e39931dbe8..34081d9962 100644
--- a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp
+++ b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp
@@ -113,8 +113,7 @@ DLLEXPORT char* XBMC_get_dvd_menu_language(void *hdl, void* cb)
if (cb == NULL)
return "";
- string buffer = ((CB_AddOnLib*)cb)->GetDVDMenuLanguage(((AddonCB*)hdl)->addonData);
- return strdup(buffer.c_str());
+ return ((CB_AddOnLib*)cb)->GetDVDMenuLanguage(((AddonCB*)hdl)->addonData);
}
DLLEXPORT void XBMC_free_string(void* hdl, void* cb, char* str)