examples: fix memory leaks in appsrc and appsrc2 examples

https://bugzilla.gnome.org/show_bug.cgi?id=785336
This commit is contained in:
Satya Prakash Gupta 2017-07-24 13:56:16 +05:30 committed by Tim-Philipp Müller
parent b4899a5a65
commit 815e72e91f
2 changed files with 10 additions and 0 deletions

View file

@ -130,6 +130,7 @@ main (int argc, char *argv[])
if (!g_file_test (filename, G_FILE_TEST_EXISTS)) {
g_print ("File %s does not exist\n", filename);
g_free (filename);
return -1;
}
@ -149,6 +150,8 @@ main (int argc, char *argv[])
if (data->source == NULL) {
g_print ("Bad source\n");
g_main_loop_unref (data->loop);
g_free (data);
return -1;
}
@ -178,6 +181,9 @@ main (int argc, char *argv[])
if (data->sink == NULL) {
g_print ("Bad sink\n");
gst_object_unref (data->source);
g_main_loop_unref (data->loop);
g_free (data);
return -1;
}

View file

@ -134,6 +134,8 @@ main (int argc, char *argv[])
if (data->source == NULL) {
g_print ("Bad source\n");
g_main_loop_unref (data->loop);
g_free (data);
return -1;
}
@ -161,6 +163,8 @@ main (int argc, char *argv[])
if (data->sink == NULL) {
g_print ("Bad sink\n");
g_main_loop_unref (data->loop);
g_free (data);
return -1;
}