mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
nmbd: don't leak cache_path onto talloc tos
Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
58b18e23e9
commit
21ed8058d2
@ -311,6 +311,7 @@ void write_browse_list(time_t t, bool force_write)
|
||||
fnamenew = talloc_asprintf(ctx, "%s.",
|
||||
fname);
|
||||
if (!fnamenew) {
|
||||
talloc_free(fname);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -319,6 +320,8 @@ void write_browse_list(time_t t, bool force_write)
|
||||
if (!fp) {
|
||||
DEBUG(0,("write_browse_list: Can't open file %s. Error was %s\n",
|
||||
fnamenew,strerror(errno)));
|
||||
talloc_free(fnamenew);
|
||||
talloc_free(fname);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -331,6 +334,8 @@ void write_browse_list(time_t t, bool force_write)
|
||||
DEBUG(0,("write_browse_list: Fatal error - cannot find my workgroup %s\n",
|
||||
lp_workgroup()));
|
||||
x_fclose(fp);
|
||||
talloc_free(fnamenew);
|
||||
talloc_free(fname);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -399,4 +404,6 @@ void write_browse_list(time_t t, bool force_write)
|
||||
chmod(fnamenew,0644);
|
||||
rename(fnamenew,fname);
|
||||
DEBUG(3,("write_browse_list: Wrote browse list into file %s\n",fname));
|
||||
talloc_free(fnamenew);
|
||||
talloc_free(fname);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user