Skip to content

Commit

Permalink
Fix crash and memory leak in groups
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfrahry committed Oct 4, 2024
1 parent 126105c commit fe60b20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/services/groups/group_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ func groupResourceCreate(ctx context.Context, d *pluginsdk.ResourceData, meta in
}

// No point in retrying if the caller wasn't specified as an owner
if len(ownersWithoutCallingPrincipal) == len(*properties.Owners) {
if len(ownersWithoutCallingPrincipal) == len(pointer.From(properties.Owners)) {
log.Printf("[DEBUG] Not retrying group creation for %q as owner was not specified", displayName)
return tf.ErrorDiagF(err, "Creating group %q", displayName)
}
Expand Down Expand Up @@ -1095,7 +1095,7 @@ func groupResourceUpdate(ctx context.Context, d *pluginsdk.ResourceData, meta in
}

existingMembers := make([]string, 0)
for resp.Model != nil {
if resp.Model != nil {
for _, m := range *resp.Model {
existingMembers = append(existingMembers, pointer.From(m.DirectoryObject().Id))
}
Expand Down

0 comments on commit fe60b20

Please sign in to comment.