summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-28 14:15:31 +0200
committerVolker Lendecke <vl@samba.org>2010-08-28 14:15:45 +0200
commit15d0d9bcfbc1489725082a4e860f9d403a874d4d (patch)
treef39518231a7ed8427fe920a732805a277d3b3d72 /source3/lib
parent460597dea16f2b5f8a4f9c6cf54b8c26bf94ed6d (diff)
downloadsamba-15d0d9bcfbc1489725082a4e860f9d403a874d4d.tar.gz
samba-15d0d9bcfbc1489725082a4e860f9d403a874d4d.tar.bz2
samba-15d0d9bcfbc1489725082a4e860f9d403a874d4d.zip
s3: Fix a (highly unlikly) memleak in set_local_machine_name()
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/substitute.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index e655128f49..d7ca1841ef 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -47,16 +47,16 @@ bool set_local_machine_name(const char *local_name, bool perm)
char *tmp_local_machine = NULL;
size_t len;
+ if (already_perm) {
+ return true;
+ }
+
tmp_local_machine = SMB_STRDUP(local_name);
if (!tmp_local_machine) {
return false;
}
trim_char(tmp_local_machine,' ',' ');
- if (already_perm) {
- return true;
- }
-
SAFE_FREE(local_machine);
len = strlen(tmp_local_machine);
local_machine = SMB_CALLOC_ARRAY(char, len+1);