commit | abfb9a5429592bf692d709c025a38d9cb4186bc2 | [log] [tgz] |
---|---|---|
author | Eric Laurent <elaurent@google.com> | Mon Apr 24 09:27:07 2023 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Mon Apr 24 09:27:07 2023 +0000 |
tree | f3fcaa5eeb42adffa4fe5713b6f5f22716699232 | |
parent | c068aa5da53f91ad1537427acefce74f589c118f [diff] | |
parent | 3f792ac85770da19b78756a538506e13a84d6a83 [diff] |
Merge "spatializer: fix resource leak when dlsym failed"
diff --git a/media/libeffects/spatializer/benchmarks/spatializer_benchmark.cpp b/media/libeffects/spatializer/benchmarks/spatializer_benchmark.cpp index e8ac480..e2177db 100644 --- a/media/libeffects/spatializer/benchmarks/spatializer_benchmark.cpp +++ b/media/libeffects/spatializer/benchmarks/spatializer_benchmark.cpp
@@ -31,6 +31,7 @@ (audio_effect_library_t*)dlsym(effectLib, AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR); if (effectInterface == nullptr) { ALOGE("dlsym failed: %s", dlerror()); + dlclose(effectLib); exit(-1); } symbol = (audio_effect_library_t)(*effectInterface);
diff --git a/media/libeffects/spatializer/tests/SpatializerTest.cpp b/media/libeffects/spatializer/tests/SpatializerTest.cpp index 110fbb1..3db42b6 100644 --- a/media/libeffects/spatializer/tests/SpatializerTest.cpp +++ b/media/libeffects/spatializer/tests/SpatializerTest.cpp
@@ -30,6 +30,7 @@ (audio_effect_library_t*)dlsym(effectLib, AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR); if (effectInterface == nullptr) { ALOGE("dlsym failed: %s", dlerror()); + dlclose(effectLib); exit(-1); } symbol = (audio_effect_library_t)(*effectInterface);