pdb->free_private_data( &(pdb->private_data) );
if ( !NT_STATUS_IS_OK( make_pdb_method_name( &pdb, lp_passdb_backend() ) ) ) {
char *msg = NULL;
- asprintf(&msg, "pdb_get_methods_reload: "
- "failed to get pdb methods for backend %s\n",
- lp_passdb_backend());
- smb_panic(msg);
+ if (asprintf(&msg, "pdb_get_methods_reload: "
+ "failed to get pdb methods for backend %s\n",
+ lp_passdb_backend()) > 0) {
+ smb_panic(msg);
+ } else {
+ smb_panic("pdb_get_methods_reload");
+ }
}
}
if ( !pdb ) {
if ( !NT_STATUS_IS_OK( make_pdb_method_name( &pdb, lp_passdb_backend() ) ) ) {
char *msg = NULL;
- asprintf(&msg, "pdb_get_methods_reload: "
- "failed to get pdb methods for backend %s\n",
- lp_passdb_backend());
- smb_panic(msg);
+ if (asprintf(&msg, "pdb_get_methods_reload: "
+ "failed to get pdb methods for backend %s\n",
+ lp_passdb_backend()) > 0) {
+ smb_panic(msg);
+ } else {
+ smb_panic("pdb_get_methods_reload");
+ }
}
}
char *escaped = NULL;
char *result = NULL;
- asprintf(&filter, "(&%s(objectclass=%s))",
- "(uid=%u)", LDAP_OBJ_SAMBASAMACCOUNT);
- if (filter == NULL) goto done;
+ if (asprintf(&filter, "(&%s(objectclass=%s))",
+ "(uid=%u)", LDAP_OBJ_SAMBASAMACCOUNT) < 0) {
+ goto done;
+ }
escaped = escape_ldap_string_alloc(username);
if (escaped == NULL) goto done;