You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coverity has marked the print_table_for_refs() function as leaking the printer variable if the flatpak_split_partial_ref_arg() test fails and the function returns FALSE:
app/flatpak-builtins-list.c:143
Type: Resource leak (RESOURCE_LEAK)
app/flatpak-builtins-list.c:131:
1. path: Condition "columns[0].name == NULL", taking false branch.
app/flatpak-builtins-list.c:134:
2. alloc_fn: Storage is returned from allocation function "flatpak_table_printer_new".
app/flatpak-table-printer.c:97:
2.1. path: Condition "__s == 1", taking false branch.
app/flatpak-table-printer.c:97:
2.2. path: Condition "0", taking false branch.
app/flatpak-table-printer.c:97:
2.3. alloc_fn: Storage is returned from allocation function "g_malloc0_n".
app/flatpak-table-printer.c:97:
2.4. assign: Assigning: "__p" = "g_malloc0_n(__n, __s)".
app/flatpak-table-printer.c:97:
2.5. assign: Assigning: "printer" = "(FlatpakTablePrinter *)({...; __p;})".
app/flatpak-table-printer.c:104:
2.6. return_alloc: Returning allocated memory "printer".
app/flatpak-builtins-list.c:134:
3. var_assign: Assigning: "printer" = storage returned from "flatpak_table_printer_new()".
app/flatpak-builtins-list.c:136:
4. path: Condition "opt_cols == NULL", taking true branch.
app/flatpak-builtins-list.c:136:
5. path: Condition "!opt_show_details", taking true branch.
app/flatpak-builtins-list.c:136:
6. noescape: Resource "printer" is not freed or pointed-to in "flatpak_table_printer_set_columns".
app/flatpak-table-printer.c:157:
6.1. noescape: "flatpak_table_printer_set_columns(FlatpakTablePrinter *, Column *, gboolean)" does not free or save its parameter "printer".
app/flatpak-builtins-list.c:139:
7. path: Condition "app_runtime", taking true branch.
app/flatpak-builtins-list.c:141:
8. path: Condition "!flatpak_split_partial_ref_arg(app_runtime, FLATPAK_KINDS_RUNTIME, NULL, NULL, &match_kinds, &match_id, &match_arch, &match_branch, error)", taking true branch.
app/flatpak-builtins-list.c:143:
9. leaked_storage: Variable "printer" going out of scope leaks the storage it points to.
Thanks
The text was updated successfully, but these errors were encountered:
smcv
added a commit
to smcv/flatpak
that referenced
this issue
Apr 15, 2021
Hello, I'm giving flatpak a very quick review as part of the Ubuntu main inclusion process. This is just a quick look, not a full audit.
flatpak/app/flatpak-builtins-list.c
Line 143 in 70a3e44
Coverity has marked the
print_table_for_refs()
function as leaking theprinter
variable if theflatpak_split_partial_ref_arg()
test fails and the function returnsFALSE
:Thanks
The text was updated successfully, but these errors were encountered: