Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d0d3e99 authored by zhangjincheng's avatar zhangjincheng Committed by jincheng zhang
Browse files

opengl: fix resource leak when dlsym failed



Bug: 280001152
Test: coverity test
Change-Id: Id189b304e791ec60c2661f941b0f0d480cf15227
Signed-off-by: default avatarzhangjincheng <zhangjincheng@xiaomi.com>
parent 16c64837
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -145,6 +145,7 @@ bool initializeAnglePlatform(EGLDisplay dpy) {


    if (!angleGetDisplayPlatform) {
    if (!angleGetDisplayPlatform) {
        ALOGE("dlsym lookup of ANGLEGetDisplayPlatform in libEGL_angle failed!");
        ALOGE("dlsym lookup of ANGLEGetDisplayPlatform in libEGL_angle failed!");
        dlclose(so);
        return false;
        return false;
    }
    }


@@ -155,6 +156,7 @@ bool initializeAnglePlatform(EGLDisplay dpy) {
    if (!((angleGetDisplayPlatform)(dpy, g_PlatformMethodNames, g_NumPlatformMethods, nullptr,
    if (!((angleGetDisplayPlatform)(dpy, g_PlatformMethodNames, g_NumPlatformMethods, nullptr,
                                    &platformMethods))) {
                                    &platformMethods))) {
        ALOGE("ANGLEGetDisplayPlatform call failed!");
        ALOGE("ANGLEGetDisplayPlatform call failed!");
        dlclose(so);
        return false;
        return false;
    }
    }
    if (platformMethods) {
    if (platformMethods) {