summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-11 21:45:55 -0800
committerJeremy Allison <jra@samba.org>2007-11-11 21:45:55 -0800
commit91c1933e675ed8bc0a0fad49a6f651273f29df95 (patch)
tree916563c7b23a02be1363109688cf0cf0c0e0df8b /source3
parent6069670f1bebc37527c8363a72a653e43fff7c0b (diff)
downloadsamba-91c1933e675ed8bc0a0fad49a6f651273f29df95.tar.gz
samba-91c1933e675ed8bc0a0fad49a6f651273f29df95.tar.bz2
samba-91c1933e675ed8bc0a0fad49a6f651273f29df95.zip
Remove a pstring.
Jeremy. (This used to be commit c0412b5d13546f388b615a073e82e7730e01d731)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_sock.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 66da297dc7..28154067d3 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1895,7 +1895,7 @@ int create_pipe_sock(const char *socket_dir,
struct stat st;
int sock;
mode_t old_umask;
- pstring path;
+ char *path = NULL;
old_umask = umask(0);
@@ -1935,11 +1935,15 @@ int create_pipe_sock(const char *socket_dir,
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock == -1) {
- perror("socket");
- goto out_umask;
+ DEBUG(0, ("create_pipe_sock: socket error %s\n",
+ strerror(errno) ));
+ goto out_close;
}
- pstr_sprintf(path, "%s/%s", socket_dir, socket_name);
+ asprintf(&path, "%s/%s", socket_dir, socket_name);
+ if (!path) {
+ goto out_close;
+ }
unlink(path);
memset(&sunaddr, 0, sizeof(sunaddr));
@@ -1958,10 +1962,13 @@ int create_pipe_sock(const char *socket_dir,
goto out_close;
}
+ SAFE_FREE(path);
+
umask(old_umask);
return sock;
out_close:
+ SAFE_FREE(path);
close(sock);
out_umask: