summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2013-11-07 00:14:05 +0000
committerRobert Mustacchi <rm@joyent.com>2013-11-07 00:19:21 +0000
commit5d08fb8ff6c45cbd777c55e4083f02f187f09de7 (patch)
treeb434d01bc878bf2d65379bd16e39fec524443fc7
parentc2e4c2f54addd8c15dc483b673b909084bfd80db (diff)
downloadillumos-joyent-5d08fb8ff6c45cbd777c55e4083f02f187f09de7.tar.gz
OS-2621 libshare sa_get_proto_status sometimes returns unallocated strings
-rw-r--r--usr/src/lib/libshare/autofs/libshare_autofs.c2
-rw-r--r--usr/src/lib/libshare/smb/libshare_smb.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/usr/src/lib/libshare/autofs/libshare_autofs.c b/usr/src/lib/libshare/autofs/libshare_autofs.c
index aace8fd4da..2e0e7b85d7 100644
--- a/usr/src/lib/libshare/autofs/libshare_autofs.c
+++ b/usr/src/lib/libshare/autofs/libshare_autofs.c
@@ -596,5 +596,5 @@ autofs_get_status(void)
{
char *state = NULL;
state = smf_get_state(AUTOFS_DEFAULT_FMRI);
- return (state != NULL ? state : "-");
+ return (state != NULL ? state : strdup("-"));
}
diff --git a/usr/src/lib/libshare/smb/libshare_smb.c b/usr/src/lib/libshare/smb/libshare_smb.c
index 76c9eb0909..2c6509f06b 100644
--- a/usr/src/lib/libshare/smb/libshare_smb.c
+++ b/usr/src/lib/libshare/smb/libshare_smb.c
@@ -1581,7 +1581,7 @@ smb_get_status(void)
{
char *state = NULL;
state = smf_get_state(SMBD_DEFAULT_INSTANCE_FMRI);
- return (state != NULL ? state : "-");
+ return (state != NULL ? state : strdup("-"));
}
/*