If a talloc function returns NULL, indicating failure, the failure could
be masked by the next talloc call allocating on the NULL context.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
/* build a query for PSO objects that apply to any of the SIDs given */
sid_filter = talloc_strdup(mem_ctx, "");
+ if (sid_filter == NULL) {
+ return ldb_oom(ldb);
+ }
for (i = 0; sid_filter && i < num_sids; i++) {
struct dom_sid_buf sid_buf;
sid_filter,
"(msDS-PSOAppliesTo=<SID=%s>)",
dom_sid_str_buf(&sid_array[i].sid, &sid_buf));
- }
-
- if (sid_filter == NULL) {
- return ldb_oom(ldb);
+ if (sid_filter == NULL) {
+ return ldb_oom(ldb);
+ }
}
/* only PSOs located in the Password Settings Container are valid */