mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
examples: fix memory leaks in appsrc and appsrc2 examples
https://bugzilla.gnome.org/show_bug.cgi?id=785336
This commit is contained in:
parent
b4899a5a65
commit
815e72e91f
2 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue