libscf: memory leaks in scf_simple_app_props_get()
There are memory leaks in scf_simple_app_props_get().
In a case there are no property groups in both svc and inst (so the condition at line 2102 is true) the scf_simple_app_props_get() will leak ret, ret->ap_fmri, and ret->ap_pglist.
2102 if (ret->ap_pglist->pg_name == NULL) 2103 return (NULL); 2104 2105 return (ret);
In addition, if there is an error condition in the scf_simple_app_props_get() and the "goto error2" is executed, we will leak sys_fmri.
To reproduce the issue download attached leaks_share.c and leaks_share.sh and run leaks_share.sh.
Updated by Marcel Telka about 7 years ago
- Status changed from Pending RTI to Resolved
- % Done changed from 0 to 100
commit afffa6e9b45cbe9b33943e26568d8ac69b899252 Author: Marcel Telka <firstname.lastname@example.org> Date: Sun Aug 18 01:06:16 2013 +0200 4062 libscf: memory leaks in scf_simple_app_props_get() Reviewed by: Jeffry Molanus <email@example.com> Reviewed by: Boris Protopopov <firstname.lastname@example.org> Reviewed by: Andy Stormont <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>