Add Null check on Return value of a function 'dlsym' 07/61407/1
authorMun, Gwan-gyeong <kk.moon@samsung.com>
Mon, 7 Mar 2016 12:48:46 +0000 (21:48 +0900)
committerMun, Gwan-gyeong <kk.moon@samsung.com>
Mon, 7 Mar 2016 12:48:46 +0000 (21:48 +0900)
Change-Id: Ibd16dfa12003dbd6964c08cd1c06688cd0aa34aa

src/modules/tracepath/coregl_tracepath.c

index 1ef736e..7d9d7c4 100644 (file)
@@ -1480,10 +1480,13 @@ finish:
        }
        if (png != NULL) {
                if (info != NULL) {
-                       dl_png_destroy_write_struct(&png, &info);
+                       if (dl_png_destroy_write_struct)
+                               dl_png_destroy_write_struct(&png, &info);
                        info = NULL;
-               } else
-                       dl_png_destroy_write_struct(&png, NULL);
+               } else {
+                       if (dl_png_destroy_write_struct)
+                               dl_png_destroy_write_struct(&png, NULL);
+               }
                png = NULL;
        }
 }