Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 862
    • Issues 862
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 40
    • Merge requests 40
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !1565

Backport !1563 “gdesktopappinfo: Fix unnecessarily copied and leaked URI list” to glib-2-64

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Philip Withnall requested to merge pwithnall/glib:backport-1563-desktop-app-info-leak-glib-2-64 into glib-2-64 Jul 06, 2020
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

When an app is spawned using g_desktop_app_info_launch_uris_with_spawn it will expand the various token in the app's commandline with the URIs of the files to open. The expand_macro() function that is used for this advances the pointer to the URI list to show up to which entries it used.

To not loose the pointer to the list head a duplicate of the URI list was actually passed to expand_macro(). However, it's not necessary to create a copy of the URI list for that as expand_macro() will only change which element the pointer will point to.

This behaviour actually caused the duplicated list to be leaked as the the list pointer is NULL once all URIs are used up by expand_macro() and thus nothing was freed at the end of the function.


Trivial backport of !1563 (merged) to glib-2-64.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: backport-1563-desktop-app-info-leak-glib-2-64