mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3: Fix a (highly unlikly) memleak in set_local_machine_name()
This commit is contained in:
parent
460597dea1
commit
15d0d9bcfb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user