Bug 1410191 - Leak in src/polkitbackend/polkitbackendauthority.c:server_handle_register_authentication_agent_with_options()
Summary: Leak in src/polkitbackend/polkitbackendauthority.c:server_handle_register_aut...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: polkit
Version: 7.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Miloslav Trmač
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 1420851
TreeView+ depends on / blocked
 
Reported: 2017-01-04 17:37 UTC by Paulo Andrade
Modified: 2020-04-15 15:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-21 19:43:32 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 99741 0 None None None 2017-02-13 15:52:51 UTC

Description Paulo Andrade 2017-01-04 17:37:08 UTC
Based on valgrind, there is a 40 byte leak:

==00:18:13:25.070 9577== 40 bytes in 1 blocks are definitely lost in loss record 1,263 of 2,339
==00:18:13:25.070 9577==    at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==00:18:13:25.070 9577==    by 0x567130D: g_malloc (in /usr/lib64/libglib-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x56870FD: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x56A5613: g_variant_get_child_value (in /usr/lib64/libglib-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x56A2E6E: ??? (in /usr/lib64/libglib-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x56A3E59: g_variant_get_va (in /usr/lib64/libglib-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x56A4241: g_variant_get (in /usr/lib64/libglib-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x112677: server_handle_register_authentication_agent_with_options (polkitbackendauthority.c:918)
==00:18:13:25.070 9577==    by 0x112677: server_handle_method_call (polkitbackendauthority.c:1222)
==00:18:13:25.070 9577==    by 0x51242F0: ??? (in /usr/lib64/libgio-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x566BD79: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x566C0B7: ??? (in /usr/lib64/libglib-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x566C389: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4600.2)
==00:18:13:25.070 9577==    by 0x1115F4: main (polkitd.c:236)

My first guess is that it is missing a
g_variant_unref(subject_gvariant) call.

Comment 1 Miloslav Trmač 2017-01-04 18:09:37 UTC
Yeah, at a first (unverified!) glance, this seems to be an unfixed variant of https://cgit.freedesktop.org/polkit/commit/src/polkitbackend/polkitbackendauthority.c?id=ec039f9d7ede5b839f5511e26d5cd6ae9107cb2e . 

Thanks for your report.


Note You need to log in before you can comment on or make changes to this bug.