addinnetgrX may use the heap-allocated buffer, so free the buffer in this function. (cherry picked from commit 745664bd798ec8fd50438605948eea594179fba1) We need to backport this commit: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=7d174f53539bfbfa9cdfa41ead605573d3f219eb
I checked https://cov01.lab.eng.brq.redhat.com/covscanhub/task/105046/log/glibc-2.28-28.el8/scan-results.err?format=raw contains glibc-2.28/nscd/netgroupcache.c:444: use_after_free: Using freed pointer "dataset", and https://cov01.lab.eng.brq.redhat.com/covscanhub/task/105305/log/glibc-2.28-34.el8/scan-results.err?format=raw doesn't contain such a warning anymore.