File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 74
74
var report types.ImagePullReport
75
75
if err := dec .Decode (& report ); err != nil {
76
76
if errors .Is (err , io .EOF ) {
77
+ // end of stream, exit loop
77
78
break
78
79
}
79
- report .Error = err .Error () + "\n "
80
+ // Decoder error, it is unlikely that the next call would work again
81
+ // so exit here as well, the Decoder can store the error and always
82
+ // return the same one for all future calls which then causes a
83
+ // infinity loop and memory leak in pullErrors.
84
+ // https://github.com/containers/podman/issues/25974
85
+ pullErrors = append (pullErrors , fmt .Errorf ("failed to decode message from stream: %w" , err ))
86
+ break
80
87
}
81
88
82
89
select {
Original file line number Diff line number Diff line change 74
74
if errors .Is (err , io .EOF ) {
75
75
break
76
76
}
77
- return err
77
+ return fmt . Errorf ( "failed to decode message from stream: %w" , err )
78
78
}
79
79
80
80
select {
You can’t perform that action at this time.
0 commit comments