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:
Oliver Tappe 2010-12-26 15:26:58 +00:00
parent 4167bb128b
commit 9201344705

View File

@ -32,8 +32,10 @@ LoadBackend()
typedef LocaleBackend* (*symbolType)();
symbolType createInstanceFunc
= (symbolType)dlsym(imageHandle, "CreateInstance");
if (createInstanceFunc == NULL)
if (createInstanceFunc == NULL) {
dlclose(imageHandle);
return;
}
gLocaleBackend = createInstanceFunc();
}