Skip to content
Browse files

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.
  • Loading branch information...
1 parent 64a0e61 commit 98a74f45f304f4aaf0fca51d2901a5d2fa086c5c @garbear garbear committed
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/addons/library.xbmc.addon/libXBMC_addon.cpp
3 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)

0 comments on commit 98a74f4

Please sign in to comment.
Something went wrong with that request. Please try again.