I think Coverity is being too noisy here, because only if _sss_getautomntent_r() succeeds, then key and value are allocated. This fix should hopefully explain the code to Coverity, too :-)
I have a question regarding the part of code where you delete exit() calls and replace them with jumps to end: label. There are two places like this left in the code, is that ok? IMO they could also lead to proper cleanup instead of just exiting.
Thanks Jan