containers / containers/toolbox

Leaking memory allocated by libsubid

Open
#1,558 0 comments 0 reactions 0 assignees View on GitHub
1. Bug
Dominant language
Go
Stars
3.5k
Forks
262
Avg merge
3d 1h
Merged PRs (30d)
1

Description

The array of `struct subid_range` allocated by `subid_get_gid_ranges` and `subid_get_uid_ranges` needs to be freed by the libsubid API user. Currently, these are being leaked from inside `validateSubIDRanges()`. This is a fallout from:
https://github.com/containers/toolbox/commit/ca8007c192b3bb77911f5466827252f5b714811b

Shadow 4.16.0 changed the library's soname to `libsubid.so.5.0.0` and introduced `subid_free()` for this. Earlier, the convention was to use `free(3)`. See:
https://github.com/shadow-maint/shadow/commit/0217516349151ae38c68e35cfe0cb6e0e80f9224
https://github.com/shadow-maint/shadow/pull/1019
https://github.com/shadow-maint/shadow/issues/1018

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.