smbc_init_context(SMBCCTX *context)
{
int pid;
+ TALLOC_CTX *frame;
if (!context) {
errno = EBADF;
return NULL;
}
+ frame = talloc_stackframe();
+
if ((!smbc_getFunctionAuthData(context) &&
!smbc_getFunctionAuthDataWithContext(context)) ||
smbc_getDebug(context) < 0 ||
smbc_getDebug(context) > 100) {
+ TALLOC_FREE(frame);
errno = EINVAL;
return NULL;
}
if (!user) {
+ TALLOC_FREE(frame);
errno = ENOMEM;
return NULL;
}
SAFE_FREE(user);
if (!smbc_getUser(context)) {
+ TALLOC_FREE(frame);
errno = ENOMEM;
return NULL;
}
pid = getpid();
netbios_name = (char *)SMB_MALLOC(17);
if (!netbios_name) {
+ TALLOC_FREE(frame);
errno = ENOMEM;
return NULL;
}
}
if (!netbios_name) {
+ TALLOC_FREE(frame);
errno = ENOMEM;
return NULL;
}
SAFE_FREE(netbios_name);
if (!smbc_getNetbiosName(context)) {
+ TALLOC_FREE(frame);
errno = ENOMEM;
return NULL;
}
}
if (!workgroup) {
+ TALLOC_FREE(frame);
errno = ENOMEM;
return NULL;
}
SAFE_FREE(workgroup);
if (!smbc_getWorkgroup(context)) {
+ TALLOC_FREE(frame);
errno = ENOMEM;
return NULL;
}
smb_panic("error unlocking 'initialized_ctx_count'");
}
+ TALLOC_FREE(frame);
return context;
}
smbc_bool use_kerberos = false;
const char *signing_state = "off";
struct user_auth_info *auth_info = NULL;
+ TALLOC_CTX *frame;
if (! context) {
return;
}
+ frame = talloc_stackframe();
+
if (! workgroup || ! *workgroup) {
workgroup = smbc_getWorkgroup(context);
}
if (! auth_info) {
DEBUG(0, ("smbc_set_credentials_with_fallback: allocation fail\n"));
+ TALLOC_FREE(frame);
return;
}
TALLOC_FREE(context->internal->auth_info);
context->internal->auth_info = auth_info;
+ TALLOC_FREE(frame);
}