diff options
author | dougm <none@none> | 2007-04-05 07:33:45 -0700 |
---|---|---|
committer | dougm <none@none> | 2007-04-05 07:33:45 -0700 |
commit | 1d1813a7a7c570174c2b6adc372045307b266117 (patch) | |
tree | ecdf4281f6faa5ea7edfe12400c70cd398e2521c /usr/src/lib/libshare/common/scfutil.c | |
parent | f1b4288b3b466065edd5eb9868399db6a4ff283e (diff) | |
download | illumos-joyent-1d1813a7a7c570174c2b6adc372045307b266117.tar.gz |
6540816 Local Zone Assertion failed: impl_handle != NULL, file ../common/libshare.c, line 2208
Diffstat (limited to 'usr/src/lib/libshare/common/scfutil.c')
-rw-r--r-- | usr/src/lib/libshare/common/scfutil.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/usr/src/lib/libshare/common/scfutil.c b/usr/src/lib/libshare/common/scfutil.c index e4e4b1c888..914cde08d0 100644 --- a/usr/src/lib/libshare/common/scfutil.c +++ b/usr/src/lib/libshare/common/scfutil.c @@ -934,20 +934,16 @@ sa_extract_defaults(xmlNodePtr root, scfutilhandle_t *handle, * below the groups based on property groups and properties. */ int -sa_get_config(scfutilhandle_t *handle, xmlNodePtr *root, xmlDocPtr *doc, - sa_handle_t sahandle) +sa_get_config(scfutilhandle_t *handle, xmlNodePtr root, sa_handle_t sahandle) { int ret = SA_OK; scf_instance_t *instance; scf_iter_t *iter; char buff[BUFSIZ * 2]; - *doc = xmlNewDoc((xmlChar *)"1.0"); - *root = xmlNewNode(NULL, (xmlChar *)"sharecfg"); instance = scf_instance_create(handle->handle); iter = scf_iter_create(handle->handle); - if (*doc != NULL && *root != NULL && instance != NULL && iter != NULL) { - xmlDocSetRootElement(*doc, *root); + if (instance != NULL && iter != NULL) { if ((ret = scf_iter_service_instances(iter, handle->service)) == 0) { while ((ret = scf_iter_next_instance(iter, @@ -955,21 +951,14 @@ sa_get_config(scfutilhandle_t *handle, xmlNodePtr *root, xmlDocPtr *doc, if (scf_instance_get_name(instance, buff, sizeof (buff)) > 0) { if (strcmp(buff, "default") == 0) - sa_extract_defaults(*root, handle, instance); - ret = sa_extract_group(*root, handle, instance, + sa_extract_defaults(root, handle, instance); + ret = sa_extract_group(root, handle, instance, sahandle); } } } - } else { - /* if we can't create the document, cleanup */ - if (*doc != NULL) - xmlFreeDoc(*doc); - if (*root != NULL) - xmlFreeNode(*root); - *doc = NULL; - *root = NULL; } + /* always cleanup these */ if (instance != NULL) scf_instance_destroy(instance); |