summaryrefslogtreecommitdiffstats
path: root/source/smbwrapper/shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbwrapper/shared.c')
-rw-r--r--source/smbwrapper/shared.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source/smbwrapper/shared.c b/source/smbwrapper/shared.c
index 00dd30b70e1..a10ef05bfca 100644
--- a/source/smbwrapper/shared.c
+++ b/source/smbwrapper/shared.c
@@ -1,5 +1,6 @@
/*
- Unix SMB/CIFS implementation.
+ Unix SMB/Netbios implementation.
+ Version 2.0
SMB wrapper functions - shared variables
Copyright (C) Andrew Tridgell 1998
@@ -103,7 +104,6 @@ char *smbw_getshared(const char *name)
{
int i;
struct stat st;
- char *var;
lockit();
@@ -111,9 +111,8 @@ char *smbw_getshared(const char *name)
if (fstat(shared_fd, &st)) goto failed;
if (st.st_size != shared_size) {
- var = (char *)Realloc(variables, st.st_size);
- if (!var) goto failed;
- else variables = var;
+ variables = (char *)Realloc(variables, st.st_size);
+ if (!variables) goto failed;
shared_size = st.st_size;
lseek(shared_fd, 0, SEEK_SET);
if (read(shared_fd, variables, shared_size) != shared_size) {
@@ -157,7 +156,6 @@ set a variable in the shared area
void smbw_setshared(const char *name, const char *val)
{
int l1, l2;
- char *var;
/* we don't allow variable overwrite */
if (smbw_getshared(name)) return;
@@ -167,14 +165,12 @@ void smbw_setshared(const char *name, const char *val)
l1 = strlen(name)+1;
l2 = strlen(val)+1;
- var = (char *)Realloc(variables, shared_size + l1+l2+4);
+ variables = (char *)Realloc(variables, shared_size + l1+l2+4);
- if (!var) {
+ if (!variables) {
DEBUG(0,("out of memory in smbw_setshared\n"));
exit(1);
}
-
- variables = var;
SSVAL(&variables[shared_size], 0, l1);
SSVAL(&variables[shared_size], 2, l2);