After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785336 - Memory leak in appsink-src.c & appsink-src2.c example apps
Memory leak in appsink-src.c & appsink-src2.c example apps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.12.2
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-24 10:23 UTC by Satya Prakash Gupta
Modified: 2017-08-07 19:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch file is attached. (1.72 KB, patch)
2017-07-24 10:23 UTC, Satya Prakash Gupta
committed Details | Review

Description Satya Prakash Gupta 2017-07-24 10:23:34 UTC
Created attachment 356284 [details] [review]
Patch file is attached.

File : gst-plugins-base/tests/examples/app/appsink-src2.c & appsink-src.c 

Function  main:
Possible Leak occurs as previously strdup is not fixed also memory leak occurs.
main (int argc, char *argv[])

   if (!g_file_test (filename, G_FILE_TEST_EXISTS)) {
     g_print ("File %s does not exist\n", filename);
     return -1;
   }

++patch is attched for possible solution.

Kindly review the patch and provide your feedback.
Comment 1 Tim-Philipp Müller 2017-08-07 19:26:40 UTC
Thanks for the patch. I have pushed this now, but for the future please exclude everything under tests/* from your static analyzer runs.

Exiting the application will clean up resources just fine, so it's arguable whether it really makes sense to add lines of codes to free stuff everywhere or if it just adds noise to the example code.

commit 815e72e91f674dfbd3b6916872e9333d9183499d (HEAD -> master)
Author: Satya Prakash Gupta <sp.gupta@samsung.com>
Date:   Mon Jul 24 13:56:16 2017 +0530

    examples: fix memory leaks in appsrc and appsrc2 examples
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785336