summaryrefslogtreecommitdiff
path: root/usr/src/lib/libcmdutils/common
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libcmdutils/common')
-rw-r--r--usr/src/lib/libcmdutils/common/process_xattrs.c9
-rw-r--r--usr/src/lib/libcmdutils/common/sysattrs.c11
2 files changed, 5 insertions, 15 deletions
diff --git a/usr/src/lib/libcmdutils/common/process_xattrs.c b/usr/src/lib/libcmdutils/common/process_xattrs.c
index 5c8df946a1..e6a5c1f7c7 100644
--- a/usr/src/lib/libcmdutils/common/process_xattrs.c
+++ b/usr/src/lib/libcmdutils/common/process_xattrs.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -280,17 +280,10 @@ sysattr_list(char *cmd, int fd, char *fname)
f_attr_t fattr;
char *name;
- if (nvlist_alloc(&response, NV_UNIQUE_NAME, 0) != 0) {
- (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
- "%s: %s: nvlist_alloc failed\n"),
- cmd, fname);
- return (NULL);
- }
if (fgetattr(fd, XATTR_VIEW_READWRITE, &response) != 0) {
(void) fprintf(stderr, dgettext(TEXT_DOMAIN,
"%s: %s: fgetattr failed\n"),
cmd, fname);
- nvlist_free(response);
return (NULL);
}
pair = NULL;
diff --git a/usr/src/lib/libcmdutils/common/sysattrs.c b/usr/src/lib/libcmdutils/common/sysattrs.c
index a22e8e5e21..5868e765cc 100644
--- a/usr/src/lib/libcmdutils/common/sysattrs.c
+++ b/usr/src/lib/libcmdutils/common/sysattrs.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -48,18 +48,15 @@
int
sysattr_status(char *file, xattr_view_t view)
{
- nvlist_t *response;
+ nvlist_t *response = NULL;
int saveerrno;
int status;
- if (nvlist_alloc(&response, NV_UNIQUE_NAME, 0) != 0) {
- return (0);
- }
-
status = getattrat(AT_FDCWD, view, file, &response);
saveerrno = errno;
- (void) nvlist_free(response);
+ if (response)
+ (void) nvlist_free(response);
errno = saveerrno;
return (status == 0);