tests:va: Fix null ptr dereference in multi-vpp

Dereference the pointer err before null check, which raised a null
pointer dereference issue by Coverity. Modify it to do the null check
of err first, then dereference it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1143>
This commit is contained in:
Mengkejiergeli Ba 2021-10-13 17:17:44 +08:00 committed by GStreamer Marge Bot
parent 4a6cc431d2
commit b57df4cfd1

View file

@ -140,12 +140,15 @@ message_handler (GstBus * bus, GstMessage * msg, gpointer data)
GError *err = NULL;
gst_message_parse_error (msg, &err, &debug);
if (err) {
gst_printerrln ("GStreamer error: %s\n%s", err->message,
debug ? debug : "");
g_error_free (err);
}
if (debug)
g_free (debug);
if (err)
g_error_free (err);
g_main_loop_quit (app->loop);
break;