Also check for allocation failures.
Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
bool netsamlogon_cache_init(void)
{
bool first_try = true;
- const char *path = NULL;
+ char *path = NULL;
int ret;
struct tdb_context *tdb;
}
path = cache_path(NETSAMLOGON_TDB);
+ if (path == NULL) {
+ return false;
+ }
again:
tdb = tdb_open_log(path, 0, TDB_DEFAULT|TDB_INCOMPATIBLE_HASH,
O_RDWR | O_CREAT, 0600);
}
netsamlogon_tdb = tdb;
+ talloc_free(path);
return true;
clear:
if (!first_try) {
+ talloc_free(path);
return false;
}
first_try = false;