release-request-696ef4a1-3459-446f-a322-67e13926d505-for-git_oc-mr1-release-4290956 snap-temp-L88300000095517061

Change-Id: I7029816676868079353b06b668a4a768e1df37f3
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c
index e5d7db4..4edbf9b 100644
--- a/hal/audio_extn/audio_extn.c
+++ b/hal/audio_extn/audio_extn.c
@@ -118,6 +118,8 @@
                                                        "perf_lock_acq");
             if (perf_lock_acq == NULL) {
                 ALOGE("%s: Perf lock Acquire NULL", __func__);
+                dlclose(qcopt_handle);
+                qcopt_handle = NULL;
                 ret = -EINVAL;
                 goto err;
             }
@@ -125,6 +127,8 @@
                                                        "perf_lock_rel");
             if (perf_lock_rel == NULL) {
                 ALOGE("%s: Perf lock Release NULL", __func__);
+                dlclose(qcopt_handle);
+                qcopt_handle = NULL;
                 ret = -EINVAL;
                 goto err;
             }