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 747321 - basesrc: do not leak buffer pool in error case
basesrc: do not leak buffer pool in error case
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal normal
: 1.5.1
Assigned To: Ilya Konstantinov
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-04 01:15 UTC by Ilya Konstantinov
Modified: 2015-04-04 10:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstbasesrc: do not leak buffer pool in error case (892 bytes, patch)
2015-04-04 01:18 UTC, Ilya Konstantinov
committed Details | Review

Description Ilya Konstantinov 2015-04-04 01:15:37 UTC
In gst_base_src_decide_allocation_default:

        if (!gst_buffer_pool_set_config (pool, config))
          goto config_failed;
  ...

  if (pool) {
    ...
    gst_object_unref (pool);
  }

  return TRUE;

config_failed:
  config_failed:
    GST_ELEMENT_ERROR (basesrc, RESOURCE, SETTINGS,
        ("Failed to configure the buffer pool"),
        ("Configuration is most likely invalid, please report this issue."));
    return FALSE;

The pool is ref'd so it'll be leaked upon goto to config_failed.
Comment 1 Ilya Konstantinov 2015-04-04 01:18:40 UTC
Created attachment 300928 [details] [review]
gstbasesrc: do not leak buffer pool in error case
Comment 2 Tim-Philipp Müller 2015-04-04 10:16:09 UTC
Pushed, thanks. I got rid of the if(pool) bit since we know the pool is non-NULL in that case.

commit f35ec14d33ad9f7d9dece28fde973003665c538c
Author: Ilya Konstantinov <ilya.konstantinov@gmail.com>
Date:   Sat Apr 4 04:14:50 2015 +0300

    basesrc: do not leak buffer pool in error case
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747321