Merge "Fix memory leak in buildExtensionString" am: ad5012d769 am: f319a304ae

Original change: https://android-review.googlesource.com/c/device/generic/goldfish-opengl/+/2367088

Change-Id: Ic4babbfcb3e42121b9502213e5f75e9dc1d2cc3d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/system/egl/eglDisplay.cpp b/system/egl/eglDisplay.cpp
index 3950ffd..79019c8 100644
--- a/system/egl/eglDisplay.cpp
+++ b/system/egl/eglDisplay.cpp
@@ -367,6 +367,7 @@
 
         asprintf(&finalEGLExts, "%s%s", initialEGLExts, dynamicEGLExtensions.c_str());
 
+        free(initialEGLExts);
         free((char*)hostExt);
         return finalEGLExts;
     }