diff options
author | Keith M Wesolowski <wesolows@foobazco.org> | 2013-08-21 23:54:45 +0000 |
---|---|---|
committer | Keith M Wesolowski <wesolows@foobazco.org> | 2013-08-21 23:54:45 +0000 |
commit | 84a6527d59b307f3925d3dbac3728fd0d1db4706 (patch) | |
tree | 0f87ef159a57043733b2ad0f861e14d22d635942 /usr/src/lib/libscf | |
parent | 7d7a5b1f6447ad858fd291d2b95da27e7c690325 (diff) | |
parent | 2a12f85ad140e332791b4bad1208a734c3f26bf3 (diff) | |
download | illumos-joyent-release-20130822.tar.gz |
[illumos-gate merge]20130822release-20130822
commit 2a12f85ad140e332791b4bad1208a734c3f26bf3
3946 ::gcore
commit 840b2722e5294ae44aa3af6189002f521d7c50e0
3915 Add adjuncts support to the build (fix lint)
commit afffa6e9b45cbe9b33943e26568d8ac69b899252
4062 libscf: memory leaks in scf_simple_app_props_get()
commit 2fbdf8dbf01ec1c85fcd3827cdf9e9f5f46c4c8a
4061 libzfs: memory leak in iter_dependents_cb()
commit 713d6c208802cfbb806329ec0d154b641b80c355
4047 panic from dbuf_free_range() from dmu_free_object() while doing zfs receive
Diffstat (limited to 'usr/src/lib/libscf')
-rw-r--r-- | usr/src/lib/libscf/common/midlevel.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/src/lib/libscf/common/midlevel.c b/usr/src/lib/libscf/common/midlevel.c index 71b72404f1..3037e85113 100644 --- a/usr/src/lib/libscf/common/midlevel.c +++ b/usr/src/lib/libscf/common/midlevel.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include "libscf_impl.h" @@ -1842,11 +1843,14 @@ scf_simple_app_props_get(scf_handle_t *hin, const char *inst_fmri) (pgiter = scf_iter_create(h)) == NULL || (propiter = scf_iter_create(h)) == NULL || (pg = scf_pg_create(h)) == NULL || - (prop = scf_property_create(h)) == NULL) + (prop = scf_property_create(h)) == NULL) { + free(sys_fmri); goto error2; + } if (scf_handle_decode_fmri(h, sys_fmri, NULL, svc, inst, NULL, NULL, SCF_DECODE_FMRI_REQUIRE_INSTANCE) == -1) { + free(sys_fmri); if (scf_error() == SCF_ERROR_CONSTRAINT_VIOLATED) (void) scf_set_error(SCF_ERROR_INVALID_ARGUMENT); goto error2; @@ -1858,6 +1862,7 @@ scf_simple_app_props_get(scf_handle_t *hin, const char *inst_fmri) (pgname = malloc(namelen)) == NULL) { free(thispg); free(ret); + free(sys_fmri); (void) scf_set_error(SCF_ERROR_NO_MEMORY); goto error2; } @@ -2088,6 +2093,9 @@ scf_simple_app_props_get(scf_handle_t *hin, const char *inst_fmri) goto error1; } + if (ret->ap_pglist->pg_name == NULL) + goto error1; + scf_iter_destroy(pgiter); scf_iter_destroy(propiter); scf_pg_destroy(pg); @@ -2099,9 +2107,6 @@ scf_simple_app_props_get(scf_handle_t *hin, const char *inst_fmri) if (local_h) scf_handle_destroy(h); - if (ret->ap_pglist->pg_name == NULL) - return (NULL); - return (ret); /* |