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 7474 var report types.ImagePullReport
7575 if err := dec .Decode (& report ); err != nil {
7676 if errors .Is (err , io .EOF ) {
77+ // end of stream, exit loop
7778 break
7879 }
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
8087 }
8188
8289 select {
Original file line number Diff line number Diff line change 7474 if errors .Is (err , io .EOF ) {
7575 break
7676 }
77- return err
77+ return fmt . Errorf ( "failed to decode message from stream: %w" , err )
7878 }
7979
8080 select {
You can’t perform that action at this time.
0 commit comments