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 736680 - basesrc: possible pool and allocator leak in prepare_allocation()
basesrc: possible pool and allocator leak in prepare_allocation()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.4.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-15 14:55 UTC by Aurélien Zanelli
Modified: 2014-09-16 08:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
basesrc: don't leak pool and allocator when activate failed (856 bytes, patch)
2014-09-15 14:57 UTC, Aurélien Zanelli
rejected Details | Review
basesrc: handle reference in set_allocation rather than in prepare_allocation (1.26 KB, patch)
2014-09-15 14:59 UTC, Aurélien Zanelli
committed Details | Review

Description Aurélien Zanelli 2014-09-15 14:55:34 UTC
I notice that I have a bufferpool leak when start method of bufferpool returns FALSE with a source element.

It caused by the fact that gst_base_src_prepare_allocation or gst_base_src_set_allocation don't unref pool and allocator when a bufferpool can't be active.

I will attach two differents solutions.
Comment 1 Aurélien Zanelli 2014-09-15 14:57:01 UTC
Created attachment 286210 [details] [review]
basesrc: don't leak pool and allocator when activate failed

Solution 1: just unref pool and allocator in error case. It assume that gst_base_src_set_allocation take reference on pool and allocator given as argument.
Comment 2 Aurélien Zanelli 2014-09-15 14:59:38 UTC
Created attachment 286211 [details] [review]
basesrc: handle reference in set_allocation rather than in prepare_allocation

Solution 2: gst_base_src_set_allocation() now reference pool and allocator and caller gst_base_src_prepare_allocation() unref its pool and allocator.
Comment 3 Sebastian Dröge (slomo) 2014-09-16 07:18:08 UTC
commit fefd6d06a1ede32573730e1f99f19bf1da4b6fd5
Author: Aurélien Zanelli <aurelien.zanelli@parrot.com>
Date:   Mon Sep 15 16:38:17 2014 +0200

    basesrc: handle reference in set_allocation rather than in prepare_allocation
    
    Otherwise we can forget to unref objects in error cases.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736680