Bug 265145 - bectl: fix potential resource leak in bectl_locate_jail(), print_snapshots() and bectl_cmd_list()
Summary: bectl: fix potential resource leak in bectl_locate_jail(), print_snapshots()...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-11 07:53 UTC by niejianglei2021@163.com
Modified: 2022-07-11 07:54 UTC (History)
0 users

See Also:


Attachments
a possible patch (1.98 KB, patch)
2022-07-11 07:54 UTC, niejianglei2021@163.com
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description niejianglei2021@163.com 2022-07-11 07:53:03 UTC
bectl_locate_jail(), print_snapshots() and bectl_cmd_list() allocate
resource with be_prop_list_alloc(). When some error occrus, relevant
resource should be released with be_prop_list_free(). Forgetting the
release operation will cause resource leak.

This patch fix the resource leak with adding the missing
be_prop_list_free() on the error path.
Comment 1 niejianglei2021@163.com 2022-07-11 07:54:47 UTC
Created attachment 235184 [details]
a possible patch