Fix CID-5893 (resource leak):
* close the dlopen()-ed image if the locale backend could not be created git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39950 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -32,8 +32,10 @@ LoadBackend()
|
|||||||
typedef LocaleBackend* (*symbolType)();
|
typedef LocaleBackend* (*symbolType)();
|
||||||
symbolType createInstanceFunc
|
symbolType createInstanceFunc
|
||||||
= (symbolType)dlsym(imageHandle, "CreateInstance");
|
= (symbolType)dlsym(imageHandle, "CreateInstance");
|
||||||
if (createInstanceFunc == NULL)
|
if (createInstanceFunc == NULL) {
|
||||||
|
dlclose(imageHandle);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
gLocaleBackend = createInstanceFunc();
|
gLocaleBackend = createInstanceFunc();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user